安裝好CocoaPods 環境後:
1、單獨安裝CocoaAsyncSocket
打開mac 終端,ls 檢視目前目錄檔案,cd到目前工程目錄,vim Podfile
按i切換到輸入模式,輸入内容:
platform :ios, ‘10.0’
target ‘你工程名’ do
use_frameworks! # Add this if you are targeting iOS 8+ or using Swift
pod ‘CocoaAsyncSocket’
end
按esc退出輸入模式,按 :wq 儲存退出
然後進行安裝:
pod install
在工程任何地方import CocoaAsyncSocket即可使用
2、單獨安裝Kingfisher
打開mac 終端,ls 檢視目前目錄檔案,cd到目前工程目錄,vim Podfile
按i切換到輸入模式,輸入内容:
source ‘https://github.com/CocoaPods/Specs.git’
platform :ios, ‘10.0’
target ‘你工程名’ do
use_frameworks!
pod ‘Kingfisher’
end
按esc退出輸入模式,按 :wq 儲存退出
然後進行安裝:
pod install
在工程任何地方import Kingfisher即可使用
3、同時安裝CocoaAsyncSocket和Kingfisher,此時Podfile格式:
platform :ios, ‘版本’
target ‘你工程名’ do
第三方pod
end
打開mac 終端,ls 檢視目前目錄檔案,cd到目前工程目錄,vim Podfile
按i切換到輸入模式,輸入内容:
source ‘https://github.com/CocoaPods/Specs.git’
platform :ios, ‘10.0’
target ‘ECServiceCenter’ do
use_frameworks!
pod ‘CocoaAsyncSocket’
pod ‘Kingfisher’
end
按esc退出輸入模式,按 :wq 儲存退出
然後進行安裝:
pod install