1. 常規(guī)使用方法
platform :ios, '9.0'
target 'xxxx' do
pod 'RxCocoa', '~> 4.1.0'
end
2. 使用本地或者自建的庫(kù)
source 'https://github.com/CocoaPods/Specs.git'
source 'git@xxxxxxxx.git'
3. 如何直接引用本地還未上傳至POD庫(kù)的資源
# 目錄地址就是podspec文件的位置的相對(duì)位置
pod 'xxxx', :path => '../xxxx'
4. podfile 常用引入pod方式
pod '庫(kù)名', :podspec => 'podspec文件路徑' #指定導(dǎo)入庫(kù)的podspec文件路徑
pod '庫(kù)名', :git => '源碼git地址' #指定導(dǎo)入庫(kù)的源碼git地址
pod '庫(kù)名', :tag => 'tag名' #指定導(dǎo)入庫(kù)的Tag分支
pod '庫(kù)名', :path => '~/Documents/AFNetworking' #指定本地的某個(gè)庫(kù),文件夾中要有podspec文件
5. 關(guān)于podspec中引入的工程bitcode問(wèn)題
如果pod我們通過(guò)pod '庫(kù)名', :path => '~/Documents/AFNetworking'
引入,但是目標(biāo)文件中有些文件不支持bitcode,如果直接引入,報(bào)錯(cuò)
'xxxx' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target.
設(shè)置bitcode為NO也不管用
解決方案:
在podspec 中加入
s.pod_target_xcconfig = { 'ENABLE_BITCODE' => 'NO' }
即可