使用旧版 Swift 语言版本 - Xcode 8.2 [英] Use Legacy Swift Language Version - Xcode 8.2

查看:23
本文介绍了使用旧版 Swift 语言版本 - Xcode 8.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新到 Xcode 8.2 后,编译器为我的 App 目标抛出一个错误:

After updating to Xcode 8.2 the compiler throws one error for my App target:

需要为使用 Swift 的目标正确配置使用旧版 Swift 语言版本"(SWIFT_VERSION).使用 [Edit > Convert > To Current Swift Syntax…] 菜单选择 Swift 版本或使用 Build Settings 编辑器直接配置构建设置.

"Use Legacy Swift Language Version" (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.

但是在我拥有的所有目标中将其设置为 No.试图删除派生数据,清理项目目录,重新启动 Xcode.没有任何帮助.有人知道吗?

But have it set to No in all targets I have. Tried to remove Derived Data, clean project dir, restart Xcode. Nothing helps. Anyone figure it out?

//已编辑

可以肯定的是:我已将所有目标 Use Legacy Swift Language Version 设置为 No 并且该项目在 Xcode 8.1 中编译时运行良好.更新到 Xcode 8.2 后,它不起作用.

Just to be sure: I have set to ALL my targets Use Legacy Swift Language Version to No and the project worked alright when compiled in Xcode 8.1. It doesn't work after updating to Xcode 8.2.

//编辑 21.12.

// Edit 21.12.

该问题已在 Xcode 8.2.1 中修复

The issue has been fixed in Xcode 8.2.1

推荐答案

已找到解决方法.我浏览了项目中的每个目标(和项目设置,因此在项目和目标中),切换使用旧版 Swift 语言版本"从"到"并返回".然后该项目再次构建.

Found work around. I went through each target (and project settings, so both in the project and target) in my project, toggled the "Use Legacy Swift Language Version" from "No" to "Yes" and back to "No" for each. The project then built again.

这篇关于使用旧版 Swift 语言版本 - Xcode 8.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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