Reputation: 217
My problem is that after i converted to Swift 3 in xCode 8, i received 160 errors in a project, which should goes into the AppStore this week.
I downloaded Xcode 7.3 again to fix it back to swift 2.3, but 300 errors was to many for me. My question here is:
Can i convert it back with xCode or a extern program or can i maybe get the source code from the builded App on my Device ?
Upvotes: 0
Views: 347
Reputation: 71008
Unfortunately code migrators only run one direction (move to the more recent version). You're not going to find any way to automatically convert Swift 3 code to an earlier version.
As @rmaddy points out, the typical approach here is simply to roll back to an older version of your source tree from whatever your source control system is. If you don't have a source control system, you absolutely should (git is easy for simple projects, free, and integrates with Xcode). If you have any backups system then you should turn to that. (To your specific question about getting source code from the device, unfortunately it doesn't work that way-- what ends up on your device is only the compiled end product.)
Failing all of that, if you still have a pile of broken Swift 3 code, your best option is very likely to press forward with Xcode 8/Swift 3 and deal with the errors/warnings. That's a normal part of handling drastic changes to the language and they will generally be trivial to "fix" and make compatible/correct.
Upvotes: 1