Challenges of mixed SwiftUI and UIKit codebases in iOS Apps
Article Summary
Medium's iOS team has been wrestling with a codebase dating back to 2013. Migrating from UIKit to SwiftUI? It's messier than you think.
Alla Dubovska from Medium's iOS team shares hard-won lessons from integrating SwiftUI into a legacy UIKit app. This isn't a theoretical discussion—it's a field report from the trenches of production code.
Key Takeaways
- Cell sizing in mixed environments often requires building components twice
- SwiftUI TextField still doesn't meet Medium's needs despite iOS 16+ support
- View debugger shows degraded flat layers compared to UIKit's clarity
- Scroll offset values are inverted: negative in UIKit, positive in SwiftUI
- Performance issues resolved by migrating from UILabel to native SwiftUI Text
Mixing SwiftUI and UIKit creates real technical debt through code duplication, debugging challenges, and navigation complexity that teams must weigh carefully.
About This Article
Medium's iOS team had to deal with navigation system misalignment between SwiftUI's NavigationStack and NavigationSplitView versus UIKit's navigation controllers. This meant they needed extra data transformation work across their mixed codebase.
The team decided to use UIKit for app-wide navigation and keep SwiftUI's local navigation for specific feature flows. This hybrid approach reduced the architectural friction they were facing.
The team could adopt SwiftUI gradually without rewriting their entire architecture. They were able to modernize code from 2013 while keeping the app stable and keeping developers productive.