Switch Xcode between Swift 2.2 and Swift 3.0

Since I downloaded the new Xcode and converted / updated my syntax, Xcode accidentally switched between the above versions of Swift. I ran "swift -version" in my terminal and it has confirmed (for now) that I am running Swift 2.2

I saw this question ( Swift Compiler obfuscates versions 2 and 3 ), but I'm too new to add a comment and ask more questions (for example, t Do I find this in the targets section of my project?).

How to set the syntax so that it stays on Swift 3 and does not change without warning? This will be about the fourth time that I have updated everything to test / run my application.

Hope this is a problem for other people, and this question also helps them - I feel terrible when I'm new. I hope I can know enough to help other users in the near future.

+2
source share
1 answer

You can install Swift in the terminal as the same version as Xcode 8, p xcode-select. Point it to Xcode beta as follows:

sudo xcode-select --switch /Applications/Xcode-beta.app

You can also set the toolchain directly in Xcode 8, in the menu Xcode > Toolchains > Manage Toolchains:

enter image description here

+7
source

Source: https://habr.com/ru/post/1694858/


All Articles