3

I am developing an app with 20+ framework dependencies and not all of them are on 3.0 yet. So I want to keep using Swift 2.3. However, after updating my Xcode to 8.0, I can no longer build my app. 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.

So my question is how do I keep everything same after Xcode 8.0 update?

2

2 Answers 2

4

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. after building the app, there will be minor syntax issues. After fixing (not so hard) it will go as usual

Sign up to request clarification or add additional context in comments.

5 Comments

There are a lot of issues with libraries now, some of them are minor but I have no idea how to solve some of them. Is there a better way ?
If you are using source countrol please roll back to the commit in which you have not updated libs, if you have updated current libs, some of them are modified to meet swift 3.0 syntax so in this case you have errors while building, after clean commit of 2.3 which was building you should do so: Convert to latest swift syntax - LATER, DO NOT UPDATE Libs.
But if I do convert, it will be 3.0 and I dont want that, no?
1) you should not convert code to latest 3.0, 2) Do not update libs, 3) Set Use Legacy Swift Language Version to YES. everything will work.
Here is what I did. Project was working and building fine. 1. Updated Xcode8. 2. Set Use Legacy Swift Language Version to YES Is that all I need to do ?
0

You might want to read this article: https://swift.org/migration-guide/ or more specifically section Using Carthage/CocoaPods Projects.

I guess you could choose Include the source code of the project in your Xcode workspace approach. 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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.