Xcode 11 Beta 5不显示Swift 5.1

编程入门 行业动态 更新时间:2024-10-17 15:29:35
本文介绍了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

本文发布于:2023-11-26 13:33:54,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1634031.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Xcode   Beta   Swift

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!