Shopify Apr 22, 2026

Maintaining a Swift and Objective-C Hybrid Codebase

Article Summary

Adrianna Chang from Shopify reveals how to write new Swift code in legacy Objective-C apps without rewriting everything. The secret? Strategic bridging patterns that let both languages coexist.

Shopify's Mobile Store Builder team faced a common iOS dilemma: a powerful Objective-C codebase that worked well, but a desire to adopt Swift's modern features. This article shares the practical patterns they developed to maintain a hybrid codebase where Swift and Objective-C work together seamlessly.

Key Takeaways

Critical Insight

You can adopt Swift incrementally in Objective-C apps using bridging wrappers, extensions, and careful nullability annotations without a costly full rewrite.

The article includes a real WebKit bug that crashed apps and the clever category workaround that fixed it.

About This Article

Problem

Shopify's Mobile Store Builder was built on Objective-C for dynamic UI inflation from template-based configurations. A complete rewrite to Swift wasn't practical, but developers wanted to use Swift's type safety for new models.

Solution

Adrianna Chang created bridging patterns using @objc attributes to control runtime names, NSObject wrapper classes for Swift-only structs, and Swift extensions that work as Objective-C categories. This allowed the team to adopt Swift incrementally without rewriting the core Objective-C logic.

Impact

The team built type-safe Swift models alongside the dynamic Objective-C UI inflation system. This showed that hybrid codebases can work together without expensive full migrations or losing the benefits of either language.