是否可以在较旧的Xcode上编译最新的Swift版本? [英] Is it possible to compile Latest Swift version on older Xcode?
问题描述
例如,我会使用Swift 4.2,但是我不想使用Xcode 10 beta 版本,我拥有Xcode 9.4.1.
For instance, I would play around Swift 4.2, but I don't want to use Xcode 10 beta version, I have Xcode 9.4.1.
我想知道是否有办法,有可能吗?
I wonder if there is any way do it, is it possible?
推荐答案
我发现是是可能的.您可以通过安装最新的 Snapshot
I figured it out that Yes it is possible. You can achieve it by installing the latest Snapshot:
开发快照是自动生成的预编译二进制文件 由主线开发分支创建.
Development Snapshots are prebuilt binaries that are automatically created from mainline development branches.
https://swift.org/download/#snapshots
快照是一个工具链,您可以将其安装到包含最新编译器的Xcode中,从而使您能够在最新工具上构建应用.
Snapshot is a toolchain that you can install into Xcode which contains the latest compiler, leading to let you able to build your app on the latest tools.
如何在Xcode中设置快照?
1-从 Swift网站下载最新的快照(Xcode).
1- Download the latest snapshot (Xcode) from Swift website.
2-安装下载的快照 .pkg 文件.
2- Install the downloaded snapshot .pkg file.
3-运行Xcode,然后转到:Xcode->工具链->管理工具链.
3- Run Xcode and then go to: Xcode -> Toolchains -> Manage toolchains.
4-选择组件"-工具链"选项后,您应该看到:
4- After selecting "Components" - "Toolchains" options, you should see:
选择"Swift开发人员快照"即可.完成上述步骤后,您可能需要重置Xcode.
Select "Swift Developer Snapshot" and thats it! You might need to reset Xcode after doing the above steps.
提醒:您应该在完成Swift 4的播放后重新选择"Xcode 8.3.3"选项,如快速-使用下载部分:
Reminder: You should reselect "Xcode 8.3.3" option after done playing around Swift 4, as mentioned in Swift - Using Downloads section:
要提交到App Store,您必须使用以下版本构建应用 Xcode中包含的Swift版本.
To submit to the App Store you must build your app using the version of Swift that comes included within Xcode.
这篇关于是否可以在较旧的Xcode上编译最新的Swift版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!