How can I use Swift 2.2 on Xcode8?

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-02 11:01:58

问题


I had a project on Swift2.3 and XCode7. It worked well.

When I have updated it to XCode8 and Swift3 the project does not show anything on the emulator so I decided to use, at least by the moment, Swift2.2 on Xcode8 (I have a copy of the project in Swift2.2) but it gives to me the following error:

“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.

I have tried going to Build Settings > Use Legacy Swift Language Version and change the default value from Unspecified to No but the error still comes.

Further, I only have three possible values to choose: Yes, No or Unspecified but none of them work to fix the error. Nothing about SWIFT_VERSION value.

How can I continue using Swift2.2 on XCode8 without any error?

EDIT: Here you have an image about the options that I actually have:

EDIT 2: I know about this question Use Swift 2.2 in Xcode 8? but as you can see on the image above I do not have the option SWIFT_VERSION so the only answer that appears there does not work for me.

Thanks in advance!


回答1:


You have to enter the value 2.3 in there.

http://imgur.com/a/pcLIJ



来源:https://stackoverflow.com/questions/39490507/how-can-i-use-swift-2-2-on-xcode8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!