升级到Cocoapods 1.1.0 管理Alamofire适配
2016-10-28 本文已影响398人
PlusNie
Xcode 8升级后,iOS10带来了不少新的特性,也伴随着Swift3 大升级,许多第三方库也在第一时间增加了对 Swift3 的支持。比如著名的网络库 Alamofire ,在安装说明中有这样一句话:
CocoaPods 1.1.0+ is required to build Alamofire 4.0.0+.
对月CocoaPods的升级,要确保Mac系统下10.1以上,然后执行,
sudo gem install cocoapods --pre
升级如下图,

在Podfile文件中,添加Alamofire适配最新版本,
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!
target 'FunnyNews' do
pod 'Alamofire', '~> 4.0'
end
初始化加载CocoaPods,
pod install
结果如下,

看控制台输出的警告消息,我们可以看到,
Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.
意思是说,初始化要使用
pod repo update
成功更新Alamofire,
