一、pod使用
1、xcode創(chuàng)建工程,啟動終端打開工程所在文件夾;
2、終端內(nèi)輸入 pod init,為工程添加cocoapods;
3、打開出現(xiàn)的 Podfile文件,在文件內(nèi)添加要添加的第三方庫
(pod ‘Masonry’【注意大小寫】),保存更改;
4、終端執(zhí)行 pod install ,運行成功后,第三方庫(Masonry)安裝成功。二、刪除第三方庫
1、打開Podfile文件刪除要刪除的第三方庫名稱,保存文件;
2、在終端打開工程文件,輸入 pod install --verbose --no-repo-update ,運行成功后,第三方庫刪除成功。三、[!] Automatically assigning platform
ioswith version9.0on target工程名because no platform was specified. Please specify a platform for this target in your Podfile. Seehttps://guides.cocoapods.org/syntax/podfile.html#platform.
原因:可以看到其提示,沒有指定platform,默認使用了ios 9.0。我們還可以手動修改工程的Podfile文件,添加以下信息:
platform:ios, '9.0'
再次執(zhí)行pod install命令,上面的提示將不再出現(xiàn)。
(1)Podfile中 platform :ios, '9.0' 必須大于等于9.0才可以導(dǎo)入到項目中。
(2)導(dǎo)入到項目中后,Xcode 的 Deployment Target 必須大于等于9.0才可以使用。