当我尝试将Alamofire导入到我的项目中时,我得到了以下错误(Cocoapods对我不起作用,所以我必须手动导入它)。
不管怎样,我使用的是XCode 8和Swift 2.3,我得到了以下错误:
更新:我清理了XCode,下载了最新版本的Alamofire,并重启了电脑。现在,XCode似乎给了我相互冲突的错误(图片供参考)
谢谢!
发布于 2016-09-10 05:43:25
从16年9月初开始,您需要在Podfile中使用以下内容:
pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :tag => '3.5.0'
指向swift2.3分支不再起作用,因为该分支已被删除。标签'3.5.0‘指向支持Swift 2.3的master上的最新版本。
发布于 2016-09-14 13:25:03
在Xcode 8中使用Swift 2.3
Pod文件
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
target 'ProjectName' do
pod 'Alamofire'
pod 'Contentful'
pod 'ContentfulDeliveryAPI'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '2.3'
end
end
end
发布于 2016-08-02 02:57:21
有关Xcode8+ Swift 2.3对Alamofire的支持的更多信息:https://github.com/Alamofire/Alamofire/pull/1313
尝试将您的pod更新为
pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :tag => '3.5.0'
(已更新)
更新:如果你对保持Xcode7兼容性感兴趣,并且仍然能够针对iOS10/swift 2.3进行开发,那么这是一个很好的指南:http://radex.io/xcode7-xcode8/
https://stackoverflow.com/questions/38222229
复制相似问题