1> 創建podfile文件
pod init
2> 安裝第三方庫
// 在podfile中添加第三方庫如
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
use_frameworks!
target 'LiteraryHeaven' do
pod 'SVProgressHUD'
pod 'Heimdall', '~> 1.0.0'
# pod 'ReactiveCocoa','~> 4.0.0'
end
// 安裝
pod install
3> cocospod 更新
1> 先切換gem源
gem sources --remove https://rubygems.org/`
gem source -a https://gems.ruby-china.org
// 查看是否切換成功
gem source -l
打印出*** CURRENT SOURCES ***
https://gems.ruby-china.org
就說明切換成功
2>升級
sudo gem install -n /usr/local/bin cocoapods --pre
3> 查看版本
pod --version
4> 設置cocospod倉庫
pod repo update
// pod setup