xcode 不支持的 swift 版本 (SWIFT 5)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/55452274/
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:55:43  来源:igfitidea点击:

Unsupported swift version (SWIFT 5)

swiftxcode

提问by MhmdRizk

before you mark this question as a duplicate, I checked this question

在您将此问题标记为重复之前,我检查了此问题

and it didn't work for me.

它对我不起作用。

how to fix this error:

如何修复此错误:

error: SWIFT_VERSION '5.0' is unsupported, supported versions are: 3.0, 4.0, 4.2. (in target 'DropDown')

回答by Deepak Chaudhary

For XCode 10.1, select your Pods File

对于 XCode 10.1,选择您的 Pods 文件

Select Pod

选择吊舱

-> Go to Build Settings -> Choose your Pod -> Search "Swift" -> Navigate to "Swift Language version" -> Set to desired language version.

-> 转到构建设置 -> 选择您的 Pod -> 搜索“Swift” -> 导航到“Swift 语言版本”-> 设置为所需的语言版本。

enter image description here

在此处输入图片说明

回答by Rakesha Shastri

You have code which was compiled on the new Xcode 10.2 or the beta version which supports Swift 5. Update your Xcode to the latest version.

您的代码是在新的 Xcode 10.2 或支持 Swift 5 的测试版上编译的。将您的 Xcode 更新到最新版本。

回答by Dan Korkelia

After upgrading to Xcode 10.2 release make sure you reboot MacOS. I had the exact same problem and reboot helped.

升级到 Xcode 10.2 版本后,请确保重新启动 MacOS。我遇到了完全相同的问题,重新启动有帮助。