首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >Alamofire不工作(Swift/Xcode 8)

Alamofire不工作(Swift/Xcode 8)
EN

Stack Overflow用户
提问于 2016-07-06 18:51:17
回答 3查看 7.7K关注 0票数 18

当我尝试将Alamofire导入到我的项目中时,我得到了以下错误(Cocoapods对我不起作用,所以我必须手动导入它)。

不管怎样,我使用的是XCode 8和Swift 2.3,我得到了以下错误:

更新:我清理了XCode,下载了最新版本的Alamofire,并重启了电脑。现在,XCode似乎给了我相互冲突的错误(图片供参考)

谢谢!

EN

回答 3

Stack Overflow用户

发布于 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上的最新版本。

票数 15
EN

Stack Overflow用户

发布于 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
票数 4
EN

Stack Overflow用户

发布于 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/

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38222229

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档