简体   繁体   English

我如何继续使用Swift 2.3,而不是3.0,Xcode更新,无法再构建

[英]How do I keep using Swift 2.3, instead of 3.0, Xcode updated and can't build anymore

I am developing an app with 20+ framework dependencies and not all of them are on 3.0 yet. 我正在开发一个具有20多个框架依赖项的应用程序,并不是所有这些都在3.0上。 So I want to keep using Swift 2.3. 所以我想继续使用Swift 2.3。 However, after updating my Xcode to 8.0, I can no longer build my app. 但是,在将我的Xcode更新为8.0后,我无法再构建我的应用程序。 It fails with the following error: 它失败并出现以下错误:

“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.

I don't want to convert the whole project to 3.0 yet. 我不想将整个项目转换为3.0。

So my question is how do I keep everything same after Xcode 8.0 update? 所以我的问题是如何在Xcode 8.0更新后保持一致?

In case you want to use Swift 2.3 you should go to Build Settings -> Use Legacy Swift Language Version -> YES this will help you to achieve it. 如果你想使用Swift 2.3你应该去Build Settings -> Use Legacy Swift Language Version -> YES这将帮助你实现它。 after building the app, there will be minor syntax issues. 构建应用程序后,会出现轻微的语法问题。 After fixing (not so hard) it will go as usual 固定后(不那么难)它将照常进行

You might want to read this article: https://swift.org/migration-guide/ or more specifically section Using Carthage/CocoaPods Projects . 您可能需要阅读本文: https//swift.org/migration-guide/或更具体地说, 使用Carthage / CocoaPods项目

I guess you could choose Include the source code of the project in your Xcode workspace approach. 我猜您可以选择在Xcode工作区方法中包含项目的源代码 This essentially means that you keep all your code in Swift 2.3 and make a snapshot of all or some external Frameworks referenced as Pods that are not Swift 3.0 ready. 这实际上意味着您将所有代码保存在Swift 2.3中,并创建所有或部分外部框架的快照,这些框架被引用为不支持Swift 3.0的Pod。

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

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