I have checked the question related to how to find the current Swift version by the command swift --version
, but how can I upgrade my Swift version from 3.1 to 3.2? (because the Xcode 9 only supports Swift 4.0 & Swift 3.2)
To build successfully both in Xcode 8 & Xcode 9, it's better to upgrade Swift from 3.1 to 3.2. But how?
My target was to make sure build successfully both in Xcode 8 & Xcode 9, So that publish with Xcode 8 would be OK, and try out the feature of Xcode 9 is OK too. So I will not upgrade code to swift 4.0 yet until Xcode 9.0 official edition is published.
After my test, I can't convert my code from swift 3.1 to 3.2 by Xcode 8.3.3's 'edit->convert' function.
The reason why I try to convert the code to Swift 3.2 is that I will get error of "Module compiled with Swift 3.1 cannot be imported in Swift 4.0" if I build the code with Xcode 9.
Command Line Tools
switch toXCode9.1(9B55)
,Build Settings->Swift Language Version
point toSwift 3.2
. Then remove all content under folder ofDerivedData
, andclean & build
to check, then fix the build errors & warnings show in XCode 9.1. That's it. The step after this would be update to support swift4, but which may take more time. – Kobylak