How we build SwiftUI features in the Medium application
Medium's iOS team builds new iOS 13+ features in SwiftUI and Combine by splitting a monolithic, partly Objective-C codebase into Swift packages: ApolloModel for generated GraphQL models, SharedUI components, per-feature UI packages, and planned LiveService/FakeService packages. Network services are structs returning Combine publishers, with live and fake implementations injected through initializers in a style inspired by Point-Free, rather than being registered in a global service registry. Views take protocol-backed GraphQL fragments so previews and tests can use simple structs, and enum action handlers forward events to custom UIHostingControllers for app-level navigation. Building packages in isolation makes SwiftUI previews fast, though List, NavigationView and Menu still have gaps that require OS-version workarounds.
Related posts
- Challenges of mixed SwiftUI and UIKit codebases in iOS Apps
Medium Engineering mediumAdeptMixing SwiftUI into Medium's 2013-era UIKit iOS app brings recurring friction: sizing SwiftUI views hosted in UIHostingController as table/collection cells, mismatched scroll APIs (offset sign differs), and duplicated components like PostPreview implemented in both frameworks. Medium keeps UIKit for app-wide navigation and SwiftUI for local feature navigation, avoids SwiftUI TextField due to focus limitations, and notes weaker SwiftUI view debugging. A scroll performance issue from wrapping UILabel with NSAttributedString in a SwiftUI list was fixed by switching to native Text with AttributedString; raising the minimum target from iOS 13 to 16 reduced version-specific code.
- How We Built The Deals Tab in Swift UI
Etsy Code as Craft mediumAdeptEtsy rebuilt its mobile Updates tab as a new Deals tab in SwiftUI inside a modular Tuist module, which made preview builds nearly instant and let the team build modules from mock preview data about two weeks before the APIs were ready. The screen is a SwiftUI List of typed API modules decoded with a Decodable-based APIv3 layer, and nested `Previews` enums supply mock models at every level. To meet the Cyber Week deadline without rewriting legacy Objective-C code, navigation, favoriting and logging are handed back to the main target through custom `@Environment` action handlers. Legacy listing cards are injected as UIViewRepresentable view builders from the UIKit hosting controller.
- Lessons From Building iOS Widgets
Shopify Engineering mediumAdeptShopify rebuilt its iOS analytics widgets natively in SwiftUI rather than React Native, because app extensions have tight memory limits, WidgetKit serializes SwiftUI view hierarchies, and React Native had no official widget support. Each widget fetches data independently through Reportify/ShopifyQL while sharing session tokens with the app. iOS calls getTimeline and getSnapshot several times per update cycle, which caused redundant network calls and a token-refresh race that logged users out. A one-minute per-widget cache keyed on configuration fixed both problems. The post also covers a flexible metric decoder, a size-agnostic SwiftUI layout built on LazyVGrid and an OptionSet of layout options, and why relative timestamps were rejected for lack of customization.
- News from WWDC25: WebKit in Safari 26 beta
WebKit mediumAdeptSafari 26 beta ships 67 new features and 107 improvements, with the version number jumping from 18.x to 26 to match Apple's OS renumbering. Highlights include SVG and data-URL favicons, every Home Screen site opening as a web app by default on iOS/iPadOS, HDR images with the CSS dynamic-range-limit property, and a new SwiftUI-native WebKit API built around WebView and WebPage. visionOS gains the <model> element for interactive USDZ 3D content and immersive video via APMP and HLS. WebGPU with WGSL now ships across platforms, along with CSS anchor positioning and many other web platform additions.
- The evolution of Facebook’s iOS app architecture
Meta Engineering mediumAdeptFacebook's iOS app grew over ten years into a C++/Objective-C++/Swift codebase built around in-house abstractions, dynamically loaded libraries, and Buck-driven code generation. Mutable Core Data models and MVC's bidirectional data flow led to the React-inspired ComponentKit, which brought a 50% performance gain. Startup times of nearly 30 seconds drove product code into lazily loaded dylibs, whose runtime failures were later turned into build-time errors by a plugin system generated from Buck dependency-graph queries. The recurring tradeoff is user experience and reliability against idiomatic iOS development, with the Swift-era language guidance of keeping C++ out of product-facing APIs giving developer efficiency more weight.