简体   繁体   中英

How can I switch to Swift 4.0 in Xcode 9.3?

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

在此输入图像描述

Can I switch to 4.0 somehow?

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)

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM