Medium Thomas Ricouard Jun 8, 2021

How we build SwiftUI features in the Medium application

Article Summary

Medium's iOS team went all-in on SwiftUI for production features serving millions of users. Here's how they made it work in a legacy codebase.

Thomas Ricouard from Medium Engineering shares how the team (including engineers from the Glose acquisition) successfully integrated SwiftUI into Medium's iOS app that still contains Objective-C code. They built an entirely new architecture around Swift Packages, Combine, and modular design.

Key Takeaways

Critical Insight

Medium proved SwiftUI works in legacy codebases by creating a modular package architecture that delivers faster iteration and instant previews without requiring a full rewrite.

The team's approach to handling navigation between SwiftUI and UIKit reveals a pragmatic strategy that most migration guides don't mention.

About This Article

Problem

Medium's iOS app had a mix of old Objective-C code and newer Swift, so it wasn't clear if SwiftUI could work in production without rebuilding everything from scratch.

Solution

Thomas Ricouard's team built isolated Swift Packages using protocol-based abstractions and struct-based services. This let SwiftUI components develop separately from the main app, with Combine publishers handling the data flow.

Impact

Engineers could now preview SwiftUI changes instantly by compiling just the feature packages instead of the whole app. They no longer had to launch the full application to iterate on UI, which sped up the feedback loop between design and code.