简体   繁体   English

Xcode 11 Beta 5不显示Swift 5.1

[英]Xcode 11 Beta 5 not showing Swift 5.1

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. 我已经从Apple网站下载了XCode 11,并且尝试将代码升级到Swift 5.1,但是XCode却没有提供满足该选项的选项。 Also, I don't see iOS 13 simulators available. 另外,我看不到iOS 13模拟器可用。 I have never had this problem before so what am I missing? 我以前从未遇到过这个问题,所以我想念什么? My OS was updated to MacOS Catalina 我的操作系统已更新为MacOS Catalina

在此处输入图片说明

在此处输入图片说明

在此处输入图片说明

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 ). 首先要注意的是,“ Swift Language Version”下拉菜单并未选择编译器版本,而是选择了兼容模式以供编译器在其中运行(有关更多信息,请参见此处 )。

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: 可以说,在这种情况下,下拉菜单的标签是错误的,因为Xcode 11中的“ Swift 5”选项实际上意味着“ Swift 5.1”。这可以通过运行以下命令进行演示:

#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. 您会看到At least 5.1打印了At least 5.1 Interestingly this means that there's actually no way to run a 5.1 compiler with a compatibility language version of 5.0. 有趣的是,这意味着实际上没有办法使用兼容语言版本5.0来运行5.1编译器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM