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?

The Cook
  • 1,403
  • 3
  • 17
  • 33
  • I have answered a similar question to yours already: http://stackoverflow.com/questions/39485577/alamofire-not-be-code-signed-because-its-settings-dont-specify-a-development/39485655#39485655 You should be able to use it to adjust your frameworks – tech4242 Sep 22 '16 at 10:55
  • see this http://stackoverflow.com/questions/38446097/xcode-8-beta-3-use-legacy-swift-issue – Anbu.Karthik Sep 22 '16 at 11:37

2 Answers2

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

C0mrade
  • 1,215
  • 1
  • 10
  • 23
  • 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 ? – The Cook Sep 22 '16 at 11:28
  • 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. – C0mrade Sep 22 '16 at 11:30
  • But if I do convert, it will be 3.0 and I dont want that, no? – The Cook Sep 22 '16 at 11:35
  • 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. – C0mrade Sep 22 '16 at 11:36
  • 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 ? – The Cook Sep 22 '16 at 11:45
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.

vedrano
  • 2,961
  • 1
  • 28
  • 25