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
- Moved from monolithic architecture to Swift Packages for instant previews and faster builds
- Created LiveService and FakeService implementations using Combine publishers for clean testing
- Built UI features in isolated packages with action handlers for app communication
- Migrated Apollo GraphQL client from CocoaPods to Swift Package Manager
- Used protocol-backed fragments instead of concrete GraphQL types for flexible mocking
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.