![]() ![]() (You don’t need to declare variable types most of the times as Swift can infer them). Or it would try to guess local variable types wrong. Converter always picks implicitly unwrapped variables instead of optionals. Most of the bugs turned out to be wrong guesses on the optionality types of class vars. We had to use assistant view to fix remaining bugs side by side. This took 3 days as we go down all the way to 2 digits. Xcode suggested fixes (nullability checks).Swift 3 style issues (enumeration naming).Luckily there were lots of low hanging fruits: We started with 269 build errors (more like 800 as you fix, you get more :). Because of the original code, I even saw definitions like private(set) public var. But in general it looked like I saved tons of hours of mundane work to fix dots and parentheses. Some of the definitions that should’ve been on the top of the file were on the bottom. There were double definitions of the variables as they got imported from both. What I received looked like a Swift code. Then I uploaded the whole project, pressed convert button, closed my eyes and hoped for the best. I did a test on a small file, it looked good. Finally I was going through with a linter tool to catch any bad style.Īfter googling “ObjectiveC to Swift converter” I decided to give a try to Swiftify. Then I was going to catch build errors and bugs after checking line by line. I was going to see how good it can translate. I decided to take a leap in faith and try a converter tool as a starter. I didn’t want to do to mundane work of declaring each variable and function in Swift.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |