我使用的是 Xcode 8.0 GM。我创建了一个默认的单 View 应用程序,并将我的部署目标设置为 9.0。
在我的 Podfile 中,我的目标是最先进的 Swift 3 分支:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!
target 'MyProject' do
pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :branch => 'swift3'
end
我运行 pod install
并得到 ... 正在安装 Alamofire (4.0.0-beta.2)
... 太棒了,没问题。我打开 MyProject.xcworkspace
。
弹出:
我不能稍后再打,因为它告诉我:
Xcode 8 will not be able to build the target “Alamofire”, and certain editing features will not function properly until the Swift source code in this target has been converted.
那不行,我想建一个。所以我点击“转换”。它给了我选择:
这就是我想要的,Swift 3。看起来不错,我点击“下一步”。
它默认为这 3 个选定的目标。好吧好吧,我接着打。
以上帝的名义……
我想在针对 iOS 9.0 的 Xcode 8、Swift 3 项目上使用 Alamofire 的 swift3
前沿分支。我哪里出错了,我怎样才能让它工作? FWIW 我在尝试使用 Alamofire 的 Swift 2.3 分支时遇到了一堆错误,所以我知道这是我做错了什么。
最佳答案
通过命令升级到最新的 Cocoapods(在回答这个问题时:版本 1.1.0.beta.2
):
gem install cocoapods --pre
似乎解决了我的情况。
关于ios - Alamofire Xcode 8 Swift 3 导致 786 个编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39380939/