Airbnb Sep 21, 2023

Unlocking SwiftUI at Airbnb

Article Summary

Airbnb just replaced their entire iOS UI framework with SwiftUI. Here's how they pulled off a multi-million line codebase migration without breaking production.

Airbnb's iOS team spent years building Epoxy, their custom declarative UI framework on top of UIKit. But when SwiftUI matured, they made the bold decision to migrate. This is their playbook for adopting SwiftUI at scale across 500+ views and 200+ screens.

Key Takeaways

Critical Insight

Airbnb successfully migrated to SwiftUI through phased adoption, design system rebuilds, and education investments while maintaining performance and quality.

They also share 18 open bug reports with Apple and the specific SwiftUI limitations still forcing them to keep UIKit around.

About This Article

Problem

Airbnb's iOS team had thousands of screens built with UIKit and their Epoxy framework. They wanted to start using SwiftUI for new features, but rewriting everything at once wasn't realistic.

Solution

Bryn Bodayle's team created two-way bridges between the frameworks. They built an itemModel view modifier that wraps SwiftUI views in UIHostingController so they work in Epoxy lists. They also added a UIViewRepresentable extension that lets UIKit components render in SwiftUI, with proper layout support for complex views like UILabel.

Impact

By September 2023, engineers had adopted SwiftUI across 500+ views and 200+ screens at their own pace. Many of Airbnb's 2023 Summer Release features now run on SwiftUI while still working with the existing Epoxy infrastructure.

Recent from Airbnb

Related Articles