How can I migrate Swift 3 applications to Swift 5 in 2021?

I recently returned to some Swift 3 projects on a 2011 Mac Mini. I updated it to High Sierra 10.13 but it was still too old to download the latest Xcode's to update my swift projects. I waited for the Mini to get a refresh, and finally came the M1 and I bought one!

I installed the latest Xcode (12.5.1) on my lovely M1 Mini and when I open my Swift projects I am told "Unsupported Swift Version", "This version of Xcode does not support building or migrating Swift 3.x targets" and "Use Xcode 10.1 to migrate the code to Swift 4"

Fair enough. So I downloaded Xcode 10.1 from the "more" link in the download page (https://developer.apple.com/download/all/). I expanded the xip. But when I run this Xcode, it won't start. I am told "In order to use Xcode, you need to update to the latest version. The version of Xcode installed on this Mac is not compatible with macOS Big Sur. Download the latest version for free from the App Store."

So now what can I do? Please help!

Thank you!

  • Did you ever figure this out an easier way than how Claude31 did it?

Add a Comment

Replies

I do it differently, directly from XCode 12.

See my detailed explanation here:

https://developer.apple.com/forums/thread/685565?answerId=682858022#682858022

  • I tested on a project created with Swift2 ! And managed to update it directly in Xcode 13ß4 with the process I described in the link above. I had however a problem to open storyboard (kept spinning). I closed project, opened in Xcode 12. I was asked to select a device for IB. Did it, quit XCode12 and reopened in Xcode 13 without problem. I had also to recreate all IBActions connections which were visibly corrupted.

  • I filed a FB suggestion : Aug 2, 2021 at 10:27 AM – FB9442184

Add a Comment

I noticed that at https://developer.apple.com/download/all/, there is a button at the bottom of the list that says "View More". I didn't see that before. It was easy to miss. When I continue to click on that button, I eventually find Xcode 10.1.