CocoaPods是Swift和Objective-C Cocoa项目的依赖管理器。类似 PHP 的 composer, Java 的 Maven
安装
代码语言:javascript复制$ brew install cocoapods或者
代码语言:javascript复制$ sudo gem install cocoapods加速镜像
https://mirrors.tuna.tsinghua.edu.cn/help/CocoaPods/
代码语言:javascript复制cd ~/.cocoapods/repos
#可能不需要移除
pod repo remove master
#很慢,最终master目录3.2G
pod repo add master https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git使用
在项目根目录创建文件Podfile,类似
vi Podfile
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'ui-tableView' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for ui-tableView
pod "Masonry"
pod "MJExtension"
end
target '2ui-tableViewDelegate' do
use_frameworks!
pod "MJExtension"
end然后执行pod install,不出意外会创建一个项目名.xcworkspace文件,用Xcode打开即可
参考
https://www.cocoapods.org


