XCode - 手动升级到 Swift 4 [英] XCode - upgrade to Swift 4 manually

查看:42
本文介绍了XCode - 手动升级到 Swift 4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含 2 个目标的项目,两个目标共享超过 99% 的代码并且是用 Swift 3 编写的.

I have a project with 2 targets, both targets share more than 99% codes and was written in Swift 3.

当 XCode 9 可用时,正在扫描其中一个目标,代码和目标的构建设置"都针对 Swift 4 进行了更新.可悲的是,我刚刚发现另一个目标仍然标记为 Swift 3.2 语​​法.

When XCode 9 is available, one of the targets is being scanned, the codes and the target's "Build Settings" are all updated for Swift 4. Sadly, I just found out that another target is still marked as Swift 3.2 syntax.

我想通过 XCode 将第二个目标更新到 Swift 4,但是,第二个目标被标记为 Swift 3.2 语​​法,但代码已经是 Swift 4,它不可编译,因此 XCode 自动更新到 Swift 4 是没用.

I would like to update the second target to Swift 4 by XCode, however, the second target is marked as Swift 3.2 syntax but the codes are Swift 4 already, it is not compilable and thus automatic update to Swift 4 by XCode is not worked.

由于两个目标共享大部分代码,我不需要 XCode 来帮助我自动扫描或转换代码,我想将整个项目升级到 Swift 4.我已将第二个目标的构建设置中的Swift 语言版本"手动更新为 Swift 4.0.还有其他我应该注意的项目设置吗?

Since both targets share most of the codes, I do not need XCode to help me scan or convert the codes automatically, I would like to upgrade the whole project to Swift 4 instead. I have updated the "Swift Language Version" in Build Settings of the second target to Swift 4.0 manually. Is there any other project settings which I should take care too?

谢谢

推荐答案

我已手动将第二个目标的 Build Settings 中的Swift Language Version"更新为 Swift 4.0

I have updated the "Swift Language Version" in Build Settings of the second target to Swift 4.0 manually

检查 Swift 3 @objc 推理是否设置为关闭.

Check the Swift 3 @objc inference is set to off.

除此之外,你很高兴.

这篇关于XCode - 手动升级到 Swift 4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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