Xcode 9.2 is not showing Swift 4.1
Asked Answered
D

1

3

Apple compatibility documentation is mentioning that:

Swift 4.1, the default version of Swift that’s included in Xcode 9.2.

Yet, using Xcode Version 9.2 (9C40b), the choice of Swift Language Version that I have are 3.2 and 4.0:
Swift Language Version dropdown

Is it a mistake in the documentation or a problem in Xcode? Can I use Swift 4.1 with Xcode 9.2? Will I be able to submit to AppStore using it?

Donnie answered 5/3, 2018 at 2:59 Comment(2)
I believe it's a documentation problem and that Swift 4.1 is only available using Xcode 9.3.Mendymene
I report it under bugreport.apple.com/web/?problemID=39073035Mendymene
D
9

Apple documentation was incorrect, Swift documentation is correct.

Well, to be double sure of which version is supported, we'll test it:

  1. Set your command-line tools to xcode 9.2 (9C40b). It will switch to Xcode default swift version.

    sudo xcode-select --switch /Applications/Xcode.app
    
  2. Test your swift version.

    swift --version
    

Result is:

Apple Swift version 4.0.3 (swiftlang-900.0.74.1 clang-900.0.39.2)

In conclusion, it's really an Apple documentation issue:
Swift 4.1 is only natively available using Xcode 9.3+


Update: 3 months later

With the release of Xcode 10 on June 4th 2018, Apple documentation was finally correctly updated, stating that Swift 4.2 is available using Xcode 10.0+.

Donnie answered 15/3, 2018 at 2:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.