1 . 在安裝cocoapods 成功的基礎(chǔ)上, 打開你的工程文件.并將pod初始化.
$ cd yourProjectPath
$ pod init
2 .打開podFile文件, 在文件中寫入你想導(dǎo)入的第三方庫.使用(? pod +? '第三方庫名')
$? open -a Xcode Podfile
增加后的 Podfile
# Uncomment the next line to define a global platform for your project
source 'https://github.com/CocoaPods/Specs.git'
# platform :ios, '9.0'
target 'xinjiang' do
? # Comment the next line if you don't want to use dynamic frameworks
? use_frameworks!
? # Pods for xinjiang
? target 'xinjiangTests' do
??? inherit! :search_paths
??? # Pods for testing
? end
? target 'xinjiangUITests' do
??? # Pods for testing
? end
pod 'AFNetworking'
pod 'SDWebImage'
pod 'MJExtension'
pod 'CYLTabBarController'
pod 'MJRefresh'
pod 'Reachability' 網(wǎng)絡(luò)判斷
pod 'DZNEmptyDataSet'或pod 'LYEmptyView'空白頁面數(shù)據(jù)占位
pod 'IQKeyboardManager'
pod 'Masonry'
pod 'SVProgressHUD'
pod 'MBProgressHUD'
pod 'SDCycleScrollView'//輪播圖
end
3 . 將第三方庫導(dǎo)入工程中.
$ pod install --verbose --no-repo-update
上面執(zhí)行不成功加上這句代碼source 'https://github.com/CocoaPods/Specs.git'
以上不行用下面使用清華鏡像
https://mirror.tuna.tsinghua.edu.cn/help/CocoaPods/
$sudo gem install cocoapods
source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git'
鏈接:http://www.itdecent.cn/p/ff44a3639907