I have recently been 'big bang'ing all my personal projects, while modernizing library usage and such. However, this really is a pretty challenging option. On the other hand, if the Objective-C code is suboptimal, the "big bang" approach may be preferable. One issue I ran into is that an Objective-C class can not extend a Swift one, so it will be necessary to move over entire hierarchies at one time. You can then move over old code piecemeal. If the existing Objective-C code base is good, I would seriously consider it. NCiS actually works quite well it was a lot less hassle than I was expecting. I have done both "new code in Swift" and "big bang" approaches. What are the other viable approaches and best practices here? Also from time to time you'll need to do "wrappers" for objc compatibility (or restrict yourself to a compatible Swift subset). I'd like to avoid "new code in Swift", because there are no clear boundaries and no timeboxing to that. Also I don't believe in a strict discipline of 1 to 1 conversion, so I"m afraid that 6 months can stretch. The first "big bang" approach is problematic, because I won't be able to get management support for it. If we develop a new feature - make it in Swift. "new code in Swift": state that all new code should be in Swift."routine": allocate 1 day of the week for this "duty", and do a top-down migration with well-defined boundaries."big bang": just hack-hack-hack for 6 months and produce a Swift app. So far I've been considering these approaches: If I start the project I want it to be finished within a reasonable timeframe (let's say 2 years). I'm trying to come up with a migration plan that is avoiding a situation where the app is a frankenstein of intertwined Swift/ObjC code without any clear rules or boundaries between the two. In my rough estimation it would take about 6 man-months to rewrite the app from scratch (including testing). It was written by a small team (~3 people) during 3 years. The app is in Objective-C only with xib-s. What is the recommended approach to migrate an Objective-C codebase to Swift? I'm interested to compare different approaches and their pros and cons, what the development process should be and how architecture should look like.
0 Comments
Leave a Reply. |