I'm kinda new to Swift (less than 1 full year), and I'm not sure how to update to latest Swift within the new Xcode each year. My project has been started under Xcode 8
and Swift 3.2
. Now I upgraded Xcode 9
, which AFAIU supports Swift 4
.
Since I'm using Cocoapods
, I obviously updated all pods to their latest versions, which I believe is correct behavior.
However, I see that the Swift version
in target settings is still set to Swift 3.2
. What exactly does that mean? Should I change it to Swift 4
instead? Or that's just like minimum version that I have to write code according to?
Also, I have 2 warnings in the project:
Regardings Pods, it is clear that Cocoapods
will fix that, so np.
What about my Workspace? My target builds fine without errors and warnings, I'm not sure why it tells me about conversion? Shouldn't it tell an exact line in the file with code instead?
Please, describe what is the correct flow of update to latest Swift in general, and how this works with some of pods that are not updating to the latest Swift each year. Will I be forced to remove them, or like fork and update to latest Swift manually?
Xcode 11 supports development for devices running iOS 13.1. Xcode 11 supports on-device debugging for iOS 8 and later, tvOS 9 and later, and watchOS 2 and later.
Downloading and updating Xcode The current release of Xcode is available as a free download from the Mac App Store. The Mac App Store will notify you when an update is available or you can have macOS update automatically as it becomes available.
Xcode 13 is compatible with macOS Big Sur 11.3 or later.
Upgrading Xcode version, will not change/upgrade your Swift programming language version. These warning show, your current Swift programming language version is not 4.0 (it is below 4.0 i.e. 3.2).
(Also note, Xcode 9 and 8.3 both support Swift 3.2. You can work with Xcode 9 using Swift 3.2 also.)
So, if you open your Xcode 8.x project in Xcode 9, will work with Swift version 3.2.
Manually you need to change Swift 3.2 to 4.0 from project build settings.
Here is - How to see current Swift language version and change it to newer.
Also note: Once you change your swift language ensure following steps:
pod install
or pod update
)For easier migration refer these answers:
(Xcode) Menus: Edit ► Covert ► To Current Swift Syntax
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With