Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 11 Beta 5 not showing Swift 5.1

Tags:

xcode

ios

swift

I have downloaded XCode 11 from the apple website and I am trying to upgrade my code to Swift 5.1 but XCode isn't giving met that option. Also, I don't see iOS 13 simulators available. I have never had this problem before so what am I missing? My OS was updated to MacOS Catalina

enter image description here

enter image description here

enter image description here

like image 301
user1079052 Avatar asked Aug 12 '19 16:08

user1079052


People also ask

How do I upgrade my version of Swift?

You can also update every single Swift Package in your project at once. To do this, open the Files menu, navigate to Packages and then click Update to Latest Package Versions. Afterwards, make sure to test your project to see if everything still works, especially in projects with a lot of package dependencies.

What version of Swift is in Xcode 12?

Xcode 12 contains the next Swift update bundled, version 5.3. The more the Swift language advances, the more features we all get, resulting to better, safer, clearer and more robust code. Once again Swift brings improvements that most of them will be proved useful to all developers.

Is Swift installed with Xcode?

Swift 5.6. Swift 5.6 is available as part of Xcode 13.3.


1 Answers

First of all note that the "Swift Language Version" dropdown doesn't select a compiler version, but rather a compatibility mode for the compiler to run in (more on that here).

Arguably the dropdown menu is mislabelled in this case, as the "Swift 5" option really means "Swift 5.1" in Xcode 11. This can be demonstrated by running the following:

#if swift(<5.1) print("Less than 5.1") #else print("At least 5.1") #endif 

You'll see that At least 5.1 gets printed. Interestingly this means that there's actually no way to run a 5.1 compiler with a compatibility language version of 5.0.

like image 103
Hamish Avatar answered Sep 19 '22 09:09

Hamish