Our journey from Swift2.2 to Swift3.0 and back to Swift2.3

27th Sept was the decided date to upload a Swift2.2 app to the appstore. iOS10 and XCode 8 got released on Sept 13. iOS10 devices can be detected and debugged only on XCode8 ( There are some hacks out there on how to detect iOS10 devices on XCode7 also) . When we had played with the Beta bits the app was giving us some issues during migration . We converted a branch of the app to Swift3.0 using the auto-migrator and left it at that. We had decided to wait for the release so we don’t waste precious dev cycles.

Post XCode 8 release we decided to give it a spin so that we can effectively support iOS10 devices. After taking close to 2-3 hours to “verify” xCode 8 opened. We took our “auto-migrated” branch and tried to build it. The compiler hung on us numerous time and started eating memory upto 80GB memory. Many hours later we were close to panic and no-where close to a solution.

After reading a bit more we understood why the compiler is hanging on us.Reading this post helped us understand what is going wrong and how we can help the compiler by sorting by compile times and fixing the Type Inference issues that the compiler gets hung on again and again. But still the number of changes we were having to make to our app was too many for comfort so close to release and we felt we were alteast 2.5 weeks away from getting a stable and tested build for Swift 3.0 app.

Looking for alternate paths we saw that XCode8.0 also comes with Swift 2.3 and here is what it says “The version of Swift 2 (2.3) used in Xcode 8 is very close to the version used in Xcode 7.3.1”. We also read about Swift2.3 here and figured this is meant for teams like us which are well into the development cycle. We decided to upgrade to Swift 2.3 immediately , upload the app and then move to Swift3.0 post release.

The team had some questions on why we didn’t just upload a Swift2.2 app which can easily run on iOS10 devices anyway. There was no wrong or right path and the selected one will vary from one project/timing to another . What is important is that we make an informed decision and are aware of the pros and cons of various approached. Here is how we decided.

 

Release a Swift2.2 app on the AppStore

Convert to Swift2.3 and release

Convert to Swift 3 and release

Pros

  • App is fully tested and works well on iOS 9 devices.
  • There are some issues while running the code in iOS10 but we can attempt to hack and fix them by running xCode8 and xCode7 in parallel and making xCode7 detect device etc or fix in an xCode8 and then copy paste in xCode 7.
  • We need to put up a Swift 3.0 version up on the AppStore anyway so any issue received in the interim will be unsupported only for sometime.
  • Will easily meet deadlines
  • Released by Apple for the exact purpose of supporting teams like ours well ahead in the dev cycle and close to launch
  • Once we make the move we can be sure we can support an iOS9 or iOS 10 device bugs because we can detect/debug
  • The move is not as painful as an Swift3.0 migration and should take max 3 –4 days to convert and test.
  • Since we will be able to support and debug issues without hacks we can take a little more time to move to Swift3.0
  • It’s a clean hack-free solution
  • Recommended path by Apple
  • Hack-free and final

Cons

  • There are some issues when running the app on iOS10 devices esp wrt using Camera and Beacon detection. Its difficult to fix these issues without hacks because xCode7 cannot detect/debug an iOS10 device
  • When faced with an iOS10 specific bug we will be in doubt whether its because of the hack or because of the OS. For eg beacon detection is not working well in iOS10 devices and we kept wondering if its because of Swift2.2 code till we put up Swift2.3 code and tested.
  • We will need to put up a Swift3.0 version on the appstore asap post release to be able to better understand and debug issues

 

  • App will need to be retested completely on iOS9 and iOS10 post migration
  • We still need to go through the Swift3.0 pain post upgrading to Swift2.3 which will again need thorough testing
  • Will need to stretch to meet deadline.
  • Will miss deadline due to the many changes and the amount of testing required

 

Selected Path

  checkmark-green-png-images-14  

Are you in a similar dilemma? Whats your decision matrix??

Team Cennest!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>