How can I switch to Swift 4.0 in Xcode 9.3?

亡梦爱人 提交于 2019-12-10 01:50:16

问题


It seems like I have only options to go to 3.3, or unspecified:

Can I switch to 4.0 somehow?


回答1:


Make sure you have updated xCode then under Build Settings, check the drop down options for Swift Compiler - Language.

Furthermore, You can download Xcode 8.x and 9.x from Apple Download Portal, 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)




回答2:


I was able to install swift 4.0 in XCode 10 with solution from here "Switching Swift Versions inside Xcode using Toolchains".

But in the end this did not help. I stuck on error:

< unknown>:0: error: unknown argument: '-enable-batch-mode'

Even disabling not helped. I got:

< unknown>:0: error: unknown argument: '-disable-batch-mode'


"Switching Swift Versions inside Xcode using Toolchains" shortly:

  1. Download desired toolchain, and click to install.
  2. Select new toolchain in XCode Preferences.
    1. Select here:
    2. Result here:
  3. Use desired swift, beware caveats.

Another related: material.



来源:https://stackoverflow.com/questions/49667188/how-can-i-switch-to-swift-4-0-in-xcode-9-3

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