10

There's an update for Xcode 6.3 and it includes a new version of Swift (1.2). If I update, do I have to migrate all my Swift code to 1.2 or can I select an older version of Swift?

6

You have to migrate all your code to Swift 1.2 if you're using Xcode 6.3. If you go to Edit > Convert > To Latest Swift Syntax, it will help find many of the changes. However, there's still a lot of manual editing to do.

In the long run, it will serve you better to keep your Swift code at the latest version so that future migrations are easier and so that you can take advantage of future enhancements to the language.

  • 1
    Thanks for the answer! I would like to update the code, but right now I don't have the time, and I would rather not risk encountering migrating issues. But the old Xcode SourceKit Service crashes all the time, so I want to use the new version with the old Swift :( – harinsa Apr 19 '15 at 2:03
  • @Yar, you cannot select the version, which is why I provided a solution that I recommend (and Apple probably does too). – jonjesbuzz Oct 27 '15 at 23:39
3

You can select which version of Swift you'd like to use in Xcode 7.3 via the following: (Menu) XCode > Toolchains > (select your version)

enter image description here

3

You can install multiple toolchains for Xcode to use - wrote a small how-to here: https://medium.com/@pardel/using-old-versions-of-swift-in-xcode-4dd46644a257

TL;DR - Download & install old Swift toolchains from: https://swift.org/download/#releases

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .