更新Alamofire使用Swift 3
问题描述:
我在我的XCode项目中使用Alamofire使用Swift 2。在XCode 8发布后,我需要使用Swift 3编译我的应用程序。我用Alamofire在我的项目,所以我在Podfile作出如下改变它使用斯威夫特3:更新Alamofire使用Swift 3
pod 'Alamofire',
:git => 'https://github.com/Alamofire/Alamofire.git',
:branch => 'swift3'
这给了我一个错误,当我运行一个pod update
说明该分支是找不到的。我想知道是否还有其他需要在我执行Pod更新或其他分支URL之前运行的其他内容。
答
首先
更新您的Cocoapod
pod repo update
打开Podfile
添加这个,Alamofire需要使用iOS 9.0 Swift3
```
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end
添加
pod Alamofire
pod install
安装
然后Alamofire 4.0.1应安装
的swift3版本已经与主分支合并。只要确保你使用的是4.0+版本,你应该没问题。 – Rog
好的。我最初(很多次)试过它,它不会工作。不知何故,现在。 XCode:/非常感谢! –
尝试更新特定的pod文件somtimes,它会尝试更新podfile中列出的每个pod,因此请尝试“pod update Alamofire” –