简体   繁体   English

如何使用Swift 2.3而不是Xcode 8中的Swift 3来构建项目?

[英]How do I use Swift 2.3 to build my project instead of Swift 3 in Xcode 8?

I recently updated my Xcode and because of this I can't build my app. 我最近更新了Xcode ,因此无法构建我的应用程序。 I googled a couple of solutions and found out that I need to install a toolchain to use Swift 2.3 instead of Swift 3 . 我搜索了两个解决方案,发现需要安装工具链才能使用Swift 2.3而不是Swift 3 And to install a toolchain, I need to use Carthage . 要安装工具链,我需要使用Carthage

Source: 资源:

However, I am using CocoaPods for my dependencies and I can't commit to a change now. 但是,我将CocoaPods用于依赖项,因此现在无法更改。 So my question is: 所以我的问题是:

  1. Can I install the toolchain without Carthage ? 我可以在没有Carthage情况下安装工具链吗? If so how? 如果可以,怎么办?
  2. Can I use them both ? 我可以同时使用它们吗?
  3. Is there any other way? 还有其他办法吗?

Thanks in advance. 提前致谢。

EDIT: 编辑:

Tried setting "Use Legacy Swift Language Version." 尝试设置“使用旧版Swift语言版本”。 to "No". 改为“否”。 However my other frameworks (ie Alamofire ) started to show following error: 但是我的其他框架(即Alamofire )开始显示以下错误:

“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.

Your project is in Swift 2.2, not Swift 2.3. 您的项目在Swift 2.2中,而不是Swift 2.3中。 When you go to the convert menu, you'll have the option of a choosing between Swift 2.3 and Swift 3. Pick Swift 2.3 and run the conversion. 转到转换菜单时,可以在Swift 2.3和Swift 3之间进行选择。选择Swift 2.3并运行转换。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM