To use Xcode 8 with a Swift project we have to convert it to the new Swift 3 syntax.
I've a project with several cocoapods. First, I have installed all the new versions of these pods from the respective sources, so they are already converted to the Swift 3.
Then, I used the Edit -> Convert -> To current Swift syntax choosing Swift 3
for my main target (basically the real app). Everything seemed to be fine, but at the first build I received a lot of errors, even simple ones, fixable with the CMD+ALT+CTRL+F
, but they increase at every build. I think that this conversion tool is not the best one, or something went wrong..
Can you point me to the right direction?
Screenshot to show you the problems
Swift 3 is the primary development language supported within Xcode 8 so there are a couple notes to consider if you chose to continue using Swift 2.3.
You can also update every single Swift Package in your project at once. To do this, open the Files menu, navigate to Packages and then click Update to Latest Package Versions. Afterwards, make sure to test your project to see if everything still works, especially in projects with a lot of package dependencies.
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. Show activity on this post.
I know that it is sad, but there is no other solution than changing your code manually. It is the same with constrains which are also different and you have to change them all (if they are wrong) :/ .
You can goto free services (for big files you must upgrade accont) , clear and easy :
Online Convertor
You can make convertion by converting small block of code . Sometimes line by line .
Other way is to make objectiveC bridge in your swift3 project.
Use (in combination with online convertor) Auto correct from xcode 8.Its very useful (must be careful with auto correct sometimes you will degrade code ).
In the basics : Its not bad , you must fix all errors manually .Best way for learn swift 3 . 90% of errors are very easy to fix , just follow logs ...
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