Xcode 11 Beta 5不显示Swift 5.1 [英] Xcode 11 Beta 5 not showing Swift 5.1

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

问题描述

我已经从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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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