最基本寫法
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'
最后編輯于 :
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。