1. 安装
打开shell输入:
$ gem sources --remove https://rubygems.org/
等有反应之后再敲入以下命令
$ gem sources -a http://ruby.taobao.org/
$ sudo gem install cocoapods
2. 使用
打开shell输入:
$cd **/project
//where the .xcodeproj
$ pod search AFNetworking
//AFNetworking 可以换成其它想要添加的类库
$ vim Podfile
输入:
platform :ios, '7.0'
pod "AFNetworking", "~> 2.0"
重新回到shell输入:
$ pod install
open .xcworkspace
注意:以后都用工作空间也就是workspace打开项目,否则加上的框架就没用了
另:快速更新Pod的参数:
pod update --no-repo-update