xcode 从 Swift 3.x 转换为 5
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/55603668/
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
Convert from Swift 3.x to 5
提问by Lim Thye Chean
When I opened my project in Xcode 10.2, I got this message:
当我在 Xcode 10.2 中打开我的项目时,我收到以下消息:
Unsupported Swift Version …Use Xcode 10.1 to migrate the code to Swift 4.
不支持的 Swift 版本……使用 Xcode 10.1 将代码迁移到 Swift 4。
Where can I still find Xcode 10.1? So the process is to have 2 versions of Xcode, first migrate to Swift 4 then 5?
我还能在哪里找到 Xcode 10.1?所以这个过程是有 2 个版本的 Xcode,先迁移到 Swift 4 然后是 5?
PS: If I migrate the code to Swift 5, does the app still bundle Swift binary? If yes, then what's the benefits since the app still bundle Swift binary? If no, then how does it handle iOS 11.x?
PS:如果我将代码迁移到 Swift 5,应用程序是否仍然捆绑 Swift 二进制文件?如果是,那么由于应用程序仍然捆绑 Swift 二进制文件,有什么好处?如果不是,那么它如何处理 iOS 11.x?
回答by OkiRules
You need to redownload Xcode 10.1 from this page, convert your code to Swift 4, then redownload Xcode 10.2 and convert to Swift 5.
您需要从此页面重新下载 Xcode 10.1 ,将您的代码转换为 Swift 4,然后重新下载 Xcode 10.2 并转换为 Swift 5。
The only other option I can think of is changing your Swift Version in your apps bundle and then seeing if it lets you convert but I don't think it will.
我能想到的唯一其他选择是在您的应用程序包中更改您的 Swift 版本,然后查看它是否可以让您转换,但我认为不会。