全局配置
使用git
- 指定git(默认主分支):
gitpod 'AFNetworking', :git => 'https://github.com/gowalla/AFNetworking.git'
- 指定标签:
tagpod 'AFNetworking', :git => 'https://github.com/gowalla/AFNetworking.git', tag => '0.7.0'
- 指定分支:
branchpod 'AFNetworking', :git => 'https://github.com/gowalla/AFNetworking.git', branch => 'develop'
- 指定提交:
commitpod 'AFNetworking', :git => 'https://github.com/gowalla/AFNetworking.git', commit => '082f8319af'
- 指定路径(一般调试用):
pathpod 'AFNetworking', :path => '/Users/XXX/...'
使用版本:
pod 'AFNetworking', '~> 2.7.3'
- 如果不添加版本号,pod默认使用最新的
- 如果项目需要一个指定的pod,需要添加版本号,版本号说明:
pod 'YYImage' 不写具体的版本号,默认为最新版本pod 'YYImage', '1.0.4' 想要依赖库特定的版本,后面需要指定版本号pod 'YYImage', '> 1.1' 高于 1.1 (不包含 1.1) 的任何版本pod 'YYImage', '>= 1.1' 高于 1.1 (包含 1.1) 的任何版本pod 'YYImage', '< 1.1' 小于 1.1 (不包含 1.1) 的任何版本pod 'YYImage', '<= 1.1'小于 1.1 (包含 1.1) 的任何版本pod 'YYImage', '~> 1.1' >= 1.1 且< 2 的任何版本,并且始终是指定范围的最新版本pod 'YYImage', '~> 1.0.1' >= 1.0.1 且< 1.1.0 的任何版本,并且始终是指定范围的最新版本
指定子模块:subspecs
//指定引用指定子模块
pod 'QueryKit/Attribute’
//指定一个子模块集合
pod 'QueryKit', :subspecs => ['Attribute', 'QuerySet']