如何将Swift从3.1更新到3.2,而不更新到4.0 [英] How can I update swift from 3.1 to 3.2, but not to 4.0

查看:134
本文介绍了如何将Swift从3.1更新到3.2,而不更新到4.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经检查了与如何通过命令swift --version查找当前Swift版本有关的问题,但是如何将我的Swift版本从3.1升级到3.2? (因为Xcode 9仅支持Swift 4.0和Swift 3.2)

I have checked the question related to how to find the current Swift version by the command swift --version, but how can I upgrade my Swift version from 3.1 to 3.2? (because the Xcode 9 only supports Swift 4.0 & Swift 3.2)

要在Xcode 8和更高版本中都成功构建Xcode 9最好将Swift从3.1升级到3.2.但是如何?

To build successfully both in Xcode 8 & Xcode 9, it's better to upgrade Swift from 3.1 to 3.2. But how?

我的目标是确保同时在Xcode 8和更高版本中成功构建. Xcode 9,这样使用Xcode 8进行发布就可以了,尝试Xcode 9的功能也可以.因此,在Xcode 9.0正式版发布之前,我还不会将代码升级到Swift 4.0.

My target was to make sure build successfully both in Xcode 8 & Xcode 9, So that publish with Xcode 8 would be OK, and try out the feature of Xcode 9 is OK too. So I will not upgrade code to swift 4.0 yet until Xcode 9.0 official edition is published.

测试后,我无法通过Xcode 8.3.3的"edit-> convert"功能将代码从swift 3.1转换为3.2.

After my test, I can't convert my code from swift 3.1 to 3.2 by Xcode 8.3.3's 'edit->convert' function.

我尝试将代码转换为Swift 3.2的原因是,我将得到错误如果使用Xcode 9构建代码,则无法在Swift 4.0中导入使用Swift 3.1编译的模块"

The reason why I try to convert the code to Swift 3.2 is that I will get error of "Module compiled with Swift 3.1 cannot be imported in Swift 4.0" if I build the code with Xcode 9.

推荐答案

您可以尝试以下操作:

  • 构建设置-> Swift语言版本-> Swift 3.2.

  • 编辑->转换-​​>转换为当前的Swift语法.

注意:这些步骤使用Xcode 9

Noted: These step using Xcode 9

这篇关于如何将Swift从3.1更新到3.2,而不更新到4.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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