Incipia blog

Converting to Swift 3 – Lessons Learned

Gregory Klein | September 27, 2016

We are currently in the middle of converting the codebase of a medium-sized project, Gone, to Swift 3, and we knew that it wasn't going to be a trivial process. Thus far we've spent about ten hours, and I would estimate that we're about halfway done. The work required has taught our team a couple of valuable lessons that are worth pointing out:

  • The project architecture of Gone had a large part in increasing the likelihood of its survival during the conversion process. For example, Gone uses many NSOperation subclasses for executing pieces of work that occur in more than one place, like displaying a modal view of a task. The fact that the code for displaying a modal task is only written in one NSOperation subclass means that there is only one place to convert that code to Swift 3. Clean code may take more time to write, but we have found that it lends itself to a variety of scenarios, leaving the stakeholders grateful when it counts.
  • Even if the client doesn't prioritize future-proofing related work over adding new features, it's up to the development agency to effectively communicate that it's in their best interest, as the project's survival may depend on how well it is positioned to handle some form of an overhaul, like converting to Swift 3.
  • Our team is grateful that we didn't get trigger-happy with third party frameworks since they need to be updated to Swift 3, too (excluding Objective-C frameworks) – obviously this is out of our control, unless we're willing to fork whatever repo necessary and convert them to Swift 3 ourselves.
  • In taking time to think about the fastest way to fix a multitude of errors that can easily be grouped together, we have learned a fair number of useful shortcuts, such as cmd+alt+shift+F, which is "Find and Replace all in Workspace". Being comfortable with shortcuts (in any IDE) will save a lot of time.
The Bottom Line: In the world of software development and contract-based work, clean code serves as a strong insurance policy against volatility in the environment. Using third parties with caution is a healthy mindset for development teams because it will reduce the liabilities involved.

That's all for now folks! Be sure to bookmark our blog, sign up to our email newsletter for new post updates and reach out if you're interested in working with us.

Incipia is a mobile app development and marketing agency that builds and markets apps for companies, with a specialty in high-quality code architecture and keyword-based marketing optimizations. For blog/video or speaking requests, business or press inquiries please contact us or send an inquiry to hello@incipia.co.