引入第三方库
一般有三种方法, 以 PromiseKit 为例
- 在
podfile写下想引入的库, 然后pod install比如 👇
# 安装指定的版本
pod 'PromiseKit', '~> 6.15.3'
# 安装最新的版本
pod 'PromiseKit'
- 直接前往
github, 克隆仓库然后将文件夹拖入到Xcode项目中, 编译后运行. 比如 👇
git clone https://github.com/mxcl/PromiseKit.git
- 在其他库的
podspec文件中, 依赖某个库. 在执行pod install时, cocoapods 会自动下载依赖的库, 比如 👇
根据命名不同, 一般是
s或者是ss
s.dependency 'PromiseKit', '~> 6.15.3'
ss.dependency 'PromiseKit', '~> 6.15.3'
每天进步一点点, 坚持积累, 好记性不如烂笔头, 😂