Xcode 9.2没有显示Swift 4.1 [英] Xcode 9.2 is not showing Swift 4.1

查看:101
本文介绍了Xcode 9.2没有显示Swift 4.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Apple兼容性文档

Swift 4.1,它是Xcode 9.2中包含的默认Swift版本.

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

但是,使用Xcode版本9.2(9C40b),我选择的Swift语言版本是3.2和4.0:

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

是文档中的错误还是Xcode中的问题?我可以在Xcode 9.2中使用Swift 4.1吗?我可以使用它提交到AppStore吗?

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?

推荐答案

Apple文档 不正确,

Apple documentation was incorrect, Swift documentation is correct.

好吧,为确定支持哪个版本,我们将对其进行测试:

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

  1. 将命令行工具设置为xcode 9.2(9C40b).它将切换到Xcode默认swift版本.

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

  • 测试您的快速版本.

  • Test your swift version.

    swift --version
    

  • 结果是:

    Apple Swift版本4.0.3(swiftlang-900.0.74.1 clang-900.0.39.2)

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

    总而言之,这实际上是一个Apple文档问题:
    Swift 4.1仅在使用Xcode 9.3+时本地可用

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

    随着2018年6月4日Xcode 10的发布,Apple文档终于得到了正确的更新,指出可以使用Xcode 10.0+来获得Swift 4.2.

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

    这篇关于Xcode 9.2没有显示Swift 4.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆