Podfile文件书写

最基本写法

target 'MyApp' do
  pod 'AFNetworking', '~> 3.0'
end

普遍写法

# 下面两行是指明依赖库的来源地址
source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/Artsy/Specs.git'

# 平台,版本
platform :ios, '9.0'

# 忽略引入库的所有警告
inhibit_all_warnings!

# 针对MyApp target引入AFNetworking
# 针对MyAppTests target引入OCMock,
target 'MyApp' do 
    pod 'AFNetworking', '~> 3.0' 
    target 'MyAppTests' do
       inherit! :search_paths 
       pod 'OCMock', '~> 2.0.1' 
    end
end
# 这个是cocoapods的一些配置,官网并没有太详细的说明,一般采取默认就好了,也就是不写.

一些依赖写法

 pod 'AFNetworking', :git => 'https://github.com/gowalla/AFNetworking.git' //默认master
 pod 'AFNetworking', :git => 'https://github.com/gowalla/AFNetworking.git', :branch => 'develop' 
 pod 'AFNetworking', :git => 'https://github.com/gowalla/AFNetworking.git',:tag => '0.7.0' 
 pod 'AFNetworking', :git => 'https://github.com/gowalla/AFNetworking.git', :commit => '082f6719af'

 pod 'AFNetworking', :path =>'/Users/XXXXX/XXXXX/XXXXX/AFNetworking' 

 pod 'JSONKit', :podspec => 'https://example.com/JSONKit.podspec'
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。