I downloaded the XCode Beta 8 and converted all of my swift code from Swift 2.3 to Swift 3. It has caused way too many problems for me and caused me to start a project I've been working on for around 4 month. How do I convert my code from Swift 3 back to Swift 2.3?
On the build settings for the target switch "use legacy swift version" from no to yes.
That would switch the compiler back to the sane 2.x but won't change the code itself. The scope is limited to the new targets created for projects on older version of swift.
We have a potential issue though, with that what is a "legacy version" in the future version of Xcode might change.
First of all save a backup of your current project. Now!
If you don't have a backup and you're not using a version control system I believe the only way is opening your project with Xcode 7.3.1 and manually fixing the errors so to make the code compatible with Swift 2.2 again.
Even if you think you are not using a version control there's a chance Xcode automatically created a local GIT repository for you. To check this open a source file of your project and then select View > Version Editor > Show Version Editor.
Now the main area is split in 2 columns. At the bottom of the central column that separates the 2 source codes there's a button having an icon similar to Time Machine). Press on it.
Now if below the right column you can select a different date then you are actually using GIT. Just pick a date previous to the conversion and repeat for every source file in your project.
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