xcode 更新旧 Swift 项目的建议

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/56519225/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 10:58:19  来源:igfitidea点击:

Advice for updating old Swift Project

swiftxcode

提问by Hethcox

I inherited a Swift 2 project that needs to be updated to Swift 4 or 5. I downloaded XCode 8.3.3 to try and go from Swift 2 to 3 and then Swift 3 to 4 using XCode 10.1. The version of XCode that will convert from Swift 2 to 3 won't run on Mojave. Is ther an alternative approach? I'm looking at >1000 errors currently.

我继承了一个需要更新到 Swift 4 或 5 的 Swift 2 项目。我下载了 XCode 8.3.3 以尝试从 Swift 2 升级到 3,然后使用 XCode 10.1 从 Swift 3 升级到 4。将从 Swift 2 转换为 3 的 XCode 版本不会在 Mojave 上运行。有替代方法吗?我目前正在查看 >1000 个错误。

回答by matt

Is there an alternative approach

有没有替代方法

Not really. What you have discerned is right: to open the project at all, you need an older version of Xcode, but to run that, you need an older system.

并不真地。您的判断是正确的:要打开项目,您需要旧版本的 Xcode,但要运行它,您需要旧系统。

I've faced this problem in the past. If you have an oldish computer, you can install an older system, and thus run an older version of Xcode, possibly on an external drive or extra partition, and thus migrate the project forwards step by step. If you don't have an oldish computer, you mightbe able to use a virtual machine, but it would probably be simpler to get hold of an oldish computer and keep it on hand just for this purpose. That's what I do.

我过去遇到过这个问题。如果您有一台较旧的计算机,您可以安装较旧的系统,从而运行较旧版本的 Xcode,可能在外部驱动器或额外分区上,从而逐步向前迁移项目。如果您没有旧电脑,您也许可以使用虚拟机,但为了这个目的,拿到旧电脑并随身携带可能会更简单。我就是做这个的。