Conversion from Swift 3.0 to 4

142 Views Asked by At

How can I convert my code that I wrote a few years ago to Swift 4.0 without using XCode 10.1? Is there any way to run it on some online simulator or on the newest version of XCode? This is some code that I wrote for messing around and seeing what features the touchbar has. I get this message when I'm trying to open the project.XCode Message

1

There are 1 best solutions below

0
On

I'm not aware of any automatic migration tools other than the one that Apple provides in some versions of Xcode. I think your choices here are:

  • Use migration assistant in Xcode 10.1 (which is still available from developer.apple.com) to update the code more or less automatically.

  • Rewrite the code yourself.

If it's just code for experimenting with the Touch Bar, why not migrate it yourself? There are lots of resources to help you figure out what you need to change. While you're at it, you might as well move all the way to Swift 5.7 -- you'll be modernizing both your code and your knowledge of Swift.