29

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

user1079052
  • 3,803
  • 4
  • 30
  • 55
  • It is 5.1, SwiftUI is build on top of the Swift 5.1 and it depends on the many key futures it like Property wrapper, builders, etc. – Mojtaba Hosseini Aug 12 '19 at 16:05

1 Answers1

41

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.

Hamish
  • 78,605
  • 19
  • 187
  • 280