我已经从Apple网站下载了XCode 11,并且试图将我的代码升级到Swift 5.1,但是XCode却没有提供满足该要求的选项.另外,我看不到iOS 13模拟器可用.我以前从未遇到过这个问题,所以我想念什么?我的操作系统已更新为MacOS Catalina
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
推荐答案
首先请注意,快速语言版本"下拉列表未选择编译器版本,而是选择了兼容模式以供编译器在(有关此内容的更多信息).
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).
在这种情况下,可以说下拉菜单标签不正确,因为Xcode 11中的"Swift 5"选项实际上意味着"Swift 5.1".这可以通过运行以下命令来演示:
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您会看到至少打印了 5.1 .有趣的是,这意味着实际上没有办法运行兼容语言为5.0的5.1编译器.
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.
更多推荐
Xcode 11 Beta 5不显示Swift 5.1
发布评论