2016年 1月15号 cocoapods的导入

cocoapods导入第三方库

 

1.移除现有Ruby默认源

终端:gem sources --remove https://rubygems.org/

2.使用新的源

终端:gem sources -a https://ruby.taobao.org/

3.验证新源是否替换成功

终端:gem sources -l

4.安装CocoaPods

终端:sudo gem install cocoapods 

终端:pod setup

5.需要在工程里面添加一个空得文件命名为Podfile,取名为Podfile

pod 'Masonry' 

xcodeproj '/Users/huoran/Documents/IOS/Autolayout/Autolayout.xcodeproj'

6.Podfile里面将需要导入的第三方库 pod, eg: pod ‘Masonry’

7.在终端进入工程的Podfile目录输入pod install

原文地址:https://www.cnblogs.com/hmzxwky/p/5138310.html