Xcode 9.2 is not showing Swift 4.1

混江龙づ霸主 提交于 2019-12-23 16:08:51

问题


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:

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?


回答1:


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+.



来源:https://stackoverflow.com/questions/49102875/xcode-9-2-is-not-showing-swift-4-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!