Xcode 9 Swift语言版(SWIFT_VERSION) [英] Xcode 9 Swift Language Version (SWIFT_VERSION)

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

问题描述

我最近将xcode更新到版本9.在Xcode 8.x之前每当我使用 pod update 时,它会显示转换代码的更新代码到Swift 3,这样做可以解决错误。但现在它给了我这个错误:

I've recently updated xcode to version 9. Before that in Xcode 8.x whenever I use to do pod update it shows me an update code to convert the code to Swift 3 and doing that solve the errors. But now it is giving me this error:


Swift语言版本(SWIFT_VERSION)构建设置必须设置为
到使用Swift的目标的受支持值。此设置可以在构建设置编辑器中设置

The "Swift Language Version" (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. This setting can be set in the build settings editor.

对于此错误,我尝试过构建设置> Swift语言版本,它是Swift 3.2
但随着更新调用重新安装了一些像Alamofire这样的pod,它说安装Xcode 8.x将代码转换为Swift 3所以我需要安装最新Xcode的附加版本吗?如果是,那么如何使用Xcode 9安装Xcode 8?

For this error I've tried Build Settings > Swift Language Version and it was Swift 3.2 But as the update call has re-installed some of the pods like Alamofire and it says to install Xcode 8.x to convert the code to Swift 3 so do I need to install an additional version with the latest Xcode? If yes, then how can I install Xcode 8 with Xcode 9?

推荐答案

回答你的问题:

你可以下载Xcode 8。 x来自 Apple Download Portal 下载Xcode 8.3.3 (或参见:如果您有高级开发者帐户(苹果ID),请在何处下载旧版Xcode )。你可以安装&在单(mac)系统中使用Xcode 9和Xcode 8.x. (确保你有命令行工具支持两个版本的Xcode,以便与终端一起使用(参见:如何安装'命令行工具'))

Answer to your question:
You can download Xcode 8.x from Apple Download Portal or Download Xcode 8.3.3 (or see: Where to download older version of Xcode), if you've premium developer account (apple id). You can install & work with both Xcode 9 and Xcode 8.x in single (mac) system. (Make sure you've Command Line Tools supporting both version of Xcode, to work with terminal (see: How to install 'Command Line Tool'))

建议:如何迁移代码Xcode 9兼容的Swift版本(Xcode 3.2或4)

Xcode 9允许从转换/迁移Swift 3.0 仅限Swift 3.2 / 4.0 。因此,如果项目的当前版本的Swift语言低于3.0,则必须使用Xcode 8.x在Swift 3兼容版本中迁移代码。

Suggestion: How to migrate your code Xcode 9 compatible Swift versions (Xcode 3.2 or 4)
Xcode 9 allows conversion/migration from Swift 3.0 to Swift 3.2/4.0 only. So if current version of Swift language of your project is below 3.0 then you must migrate your code in Swift 3 compatible version Using Xcode 8.x.

这是常见错误消息,Xcode 9显示它在迁移过程中识别出低于3.0的Swift语言。

This is common error message that Xcode 9 shows it identifies Swift language below 3.0, during migration.

< img src =https://i.stack.imgur.com/gem0b.pngalt =在此输入图像说明>


Swift 3.2是由Xcode 9& Xcode 8。


Swift 3.2 is supported by Xcode 9 & Xcode 8 both.



项目►(选择您的项目目标)►构建设置►(输入'swift'在搜索栏中)Swift编译器语言►Swift语言版►单击语言列表将其打开。

Project ► (Select Your Project Target) ► Build Settings ► (Type 'swift' in Searchbar) Swift Compiler Language ► Swift Language Version ► Click on Language list to open it.




使用Xcode 8将源代码从Swift 2.0转换为3.2,然后继续使用Xcode 9(Swift 3.2或4)。



Convert your source code from Swift 2.0 to 3.2 using Xcode 8 and then continue with Xcode 9 (Swift 3.2 or 4).

为了更轻松地迁移代码,请按照以下步骤操作:(它将帮助您转换为Xcode工具支持的swift的最新版本)

For easier migration of your code, follow these steps: (it will help you to covert into latest version of swift supported by your Xcode Tool)


Xcode:菜单:编辑▶隐藏▶到当前的Swift语法

Xcode: Menus: Edit ▶ Covert ▶ To Current Swift Syntax

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

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