Hey iOS developer! 👋
As developers, we’d all love to work on fresh projects using the latest Swift and SwiftUI APIs, free from the complexities of legacy code written by someone else.
However, many apps on the App Store still rely on outdated Objective-C code, and someone needs to maintain and update them. To me, this isn’t a burden - it’s an opportunity. There are plenty of ways to stay up to date.
Even with legacy code, you can still implement modern Swift APIs, so in this issue of Curated iOS, we’ll explore how to work with legacy code - or migrate to SwiftUI if necessary.
How the Medium iOS team works effectively with legacy code
Can you imagine - Medium’s iOS legacy code is over 10 years old? In this article, Zouhair Mahieddine shares how the Medium iOS team effectively works with it and explains why they chose not to rewrite.
Read on Medium
Adding Functionality to Legacy Code without Modifying It: Decorator Pattern Swift iOS
Ever been in a situation where you need to extend the functionality, but can't modify the existing class? Islam Moussa provides a practical example of enhancing original class without modifying its code by adapting Decorator pattern and a protocols. I love such approach as we can still make meaningful updates without diving deep into the refactoring the existing code.
Read on Medium
Safely Extending Legacy Code: A Swift Approach Using Protocols, Mocking, and Unit Testing
In another article, Islam Moussa explains how to use protocols and mocks to extend legacy code functionality while ensuring stability.
Read on Medium
Did you know that the Curated iOS newsletter is published twice a week?
In addition to the traditional Wednesday issues, I’m sending out Monday emails with a series of personal articles called Monday Quick Read.This week, I talked about why ability to understand business logic can help you become better developer.
Taming Legacy Code: Refactoring for the Future with Bogdan
Walid Sassi, along with Bogdan Poplauschi, discusses the challenges of working with an old codebase and shares practical tips for improving legacy code while maintaining its functionality and integrity. These must-watch videos help explain what legacy code is, which refactoring strategies can be applied, and how to test the refactored code.
Watch on YouTube - Part 1
Watch on YouTube - Part 2
Integrating Objective-C Classes into a Swift Project
For many of us, working with legacy code means working with Objective-C. In this step-by-step guide, Cong Le walks through how to integrate Objective-C classes into a Swift codebase.
Read on Medium
Converting an App from Obj-C
Finally, if you do need to rewrite an Objective-C app in SwiftUI, check out Sarah Reichelt’s experience with it. It’s a great read, and can help guide you through what can often feel like an overwhelming task.
Read on TrozWare
If you’ve enjoyed this article - hit the Like button and subscribe, if you haven’t already!
Connect with me on LinkedIn.
Stay tuned for more in the upcoming issues. Until next time!
Artjoms