cocoapods

1
2
3
4
5
6
7
8
9
10
11
12
13
* ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
* curl -L https://get.rvm.io |bash -s stable
* source ~/.rvm/scripts/rvm
* rvm -v
* rvm install 2.0.0
* gem sources --remove https://rubygems.org/
* gem sources -a http://ruby.taobao.org/
* sudo gem install cocoapods
* 建个工程
* 在工程中建立一个文件 vi Podfile
* pod install-->在这个文件中添加要第三方库
* pod update 更新已有库或者将新库下载下来
* 搜索资源:pod search + 第三方库

podFile的内容格式

1
2
3
4
5
6
7
8
source 'https://github.com/CocoaPods/Specs.git'
platform:ios ,'7.0'
pod "AFNetworking", "~>2.0"
pod "SDWebImage","~>3.0"
pod "FMDB"
pod "BSImagePicker"
**注意:第一行的命令是因为之前的仓库被替换,特意加的