Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert from Swift 3.x to 5

When I opened my project in Xcode 10.2, I got this message:

Unsupported Swift Version …Use Xcode 10.1 to migrate the code to Swift 4.

Where can I still find Xcode 10.1? So the process is to have 2 versions of Xcode, first migrate to Swift 4 then 5?

PS: If I migrate the code to Swift 5, does the app still bundle Swift binary? If yes, then what's the benefits since the app still bundle Swift binary? If no, then how does it handle iOS 11.x?

like image 484
Lim Thye Chean Avatar asked Apr 10 '19 01:04

Lim Thye Chean


People also ask

How do I migrate to Swift 5?

You will need to manually select the new scheme, then run Edit -> Convert -> To Current Swift Syntax to migrate the remaining schemes. Or you can create a scheme that includes all the targets from your project, and have it selected before running the migration assistant.

How do I transfer my Swift 3 code to Swift 4?

Go to project navigator> Build Settings. search for swift Compiler - Language and change this to desired version.

How do I change the version of Swift?

Switching Swift Toolchain It can be done using Xcode, Go to Xcode->Preferences->Components-> Toolchains section and Select the Swift. 3.1. 1 snapshot, this will set the new Swift version for the local Xcode. You may need to restart Xcode.


1 Answers

You need to redownload Xcode 10.1 from this page, convert your code to Swift 4, then redownload Xcode 10.2 and convert to Swift 5.

The only other option I can think of is changing your Swift Version in your apps bundle and then seeing if it lets you convert but I don't think it will.

like image 106
Oscar Avatar answered Sep 20 '22 21:09

Oscar