> Markdown version of [/videos/134-swiftui-in-production](https://www.wearedevelopers.com/videos/134-swiftui-in-production). Every page supports `.md` or `Accept: text/markdown`. Links point to the HTML versions so they work for humans too. Agent guide: [/agents.md](https://www.wearedevelopers.com/agents.md). --- # SwiftUI In Production Is SwiftUI ready for a massive legacy Objective-C codebase? Learn how to conquer opaque crashes and complex UIKit bridging to ship robust, production-ready enterprise SDKs. - **Speakers:** Peter Steinberger - **Event:** WeAreDevelopers LIVE - **Published:** April 28, 2021 - **Duration:** 39:49 - **URL:** https://www.wearedevelopers.com/videos/134-swiftui-in-production ## Summary Adopting SwiftUI in production presents a unique challenge for established SDKs, balancing the promise of declarative state management against the inherent risks of a nascent framework. While SwiftUI dramatically simplifies complex UI updates and eliminates Interface Builder merge conflicts, migrating a massive legacy Objective-C codebase requires strategic encapsulation. By wrapping SwiftUI inside a UIHostingController, modern views—like a completely rewritten electronic signature flow—can seamlessly bridge to legacy fallback logic without exposing implementation details to API consumers. Because native SwiftUI currently lacks APIs for high-frequency, predictive Apple Pencil touches, highly optimized drawing components must still rely on legacy Objective-C++ views wrapped via UIViewRepresentable and connected to reactive Combine publishers using KVO mapping. Shipping stable framework code also demands creatively bypassing current limitations; for example, retrofitting custom iPhone popovers by embedding a dummy view to sequentially traverse the responder chain, or meticulously introspecting the SwiftUI view hierarchy to force first-responder status on a hidden UITextField. Furthermore, dealing with notoriously opaque AttributedGraph precondition crashes requires specialized mitigations, such as proactively neutralizing inner metrics callbacks inside a GeometryReader when targeting Mac Catalyst. Similarly, manually calculating layout overlap via notification coordinators remains essential to inject keyboard avoidance for environments lacking modern OS safeguards. Although engineering these intricate wrappers and UIKit bridges does not instantly reduce initial development time, the resulting architecture yields fundamentally more reliable state correctness, equips engineering teams with a robust library of backward-compatible workarounds, and modernizes the enterprise release pipeline. **Keywords:** swiftui production deployment, declarative state management, uihostingcontroller legacy bridging, objective-c migration, uiviewrepresentable wrapper patterns, uikit interoperability, combine publisher mapping, custom popover presentation, responder chain traversal, attributedgraph crash mitigation, geometryreader debugging, view hierarchy introspection, manual keyboard avoidance, mac catalyst compatibility, declarative ui workarounds ## Chapters 1. **Evaluating declarative interface readiness for production environments** (00:17) — Early experiences with modern interface tools reveal a mix of rapid development benefits and significant stability challenges. 1. **Testing experimental frameworks in constrained application environments** (04:30) — Rewriting basic settings menus in a smaller app provides a safe environment to learn new declarative paradigms. 1. **Replacing legacy signature flows with declarative components** (05:47) — Upgrading an aging electronic signature interface improves the developer experience for handling complex application states. 1. **Preventing merge conflicts by enforcing programmatic user interfaces** (07:09) — Mandating programmatic interface construction avoids the traditional pain points of collaboration with visual interface builder tools. 1. **Integrating high-performance native code inside declarative views** (08:13) — Retaining existing low-level drawing logic provides native performance beyond current declarative input capabilities. 1. **Supporting legacy operating systems via conditional hosting controllers** (09:43) — Encapsulating new declarative code inside hosting controllers maintains seamless backward compatibility for older deployment targets. 1. **Targeting specific operating system versions with stable platform workarounds** (12:07) — Selectively implementing platform-specific workarounds on finalized older operating systems prevents regressions during future system updates. 1. **Bridging responder chains to enable native popover presentations** (14:05) — Walking the responder chain to access internal view controllers enables native presentation styles missing from declarative frameworks. 1. **Placing navigation elements using targeted open-source layout extensions** (20:10) — Selectively importing specific components from external packages fills gaps in navigation bar alignment without bloating bundle size. 1. **Diagnosing internal graph crashes triggered by complex declarative layouts** (23:10) — Avoiding specific nested container closures prevents irreproducible differential layout crashes on older system versions. 1. **Bridging legacy objects to reactive observation state protocols** (26:26) — Manually triggering standard publisher events bypasses inheritance limitations when maintaining older data model compatibility. 1. **Gaining automatic input focus through underlying platform introspections** (27:42) — Subclassing base view initializers uncovers underlying platform text fields to manually invoke keyboard responder logic. 1. **Preventing continuous scaling layout loops through custom view extensions** (31:28) — Encapsulating specific typography scaling rules inside custom extensions resolves catastrophic interface layout infinite loops. 1. **Encapsulating complex drawing canvases within simple declarative representable structures** (32:13) — Constructing standard representable wrappers with declarative update blocks modernizes imperative configuration patterns efficiently. 1. **Converting legacy observer events into unified reactive communication streams** (33:04) — Mapping older observer callbacks into native publishers creates seamless data flows for modern declarative interface elements. 1. **Calculating spatial intersections to retrofit custom dynamic layout adjustments** (34:54) — Calculating frame intersections within a custom view coordinator mimics system-level keyboard avoidance adjustments missing on older platforms. 1. **Validating team adoption of robust declarative state management patterns** (38:36) — Executing new technology trials provides engineering teams with confident state management patterns despite requiring robust compatibility adjustments. ## Related Moments - [Production scaling strategies and SwiftUI view styling techniques](https://www.wearedevelopers.com/videos/183-from-zero-to-mobile-developer-in-45-minutes-with-swiftui) (from "From Zero to Mobile Developer in 45 Minutes With SwiftUI") - [Analyzing SwiftUI as an internal domain specific language](https://www.wearedevelopers.com/videos/707-create-dsl-domain-specific-language-on-top-of-swift) (from "Create DSL (Domain Specific Language) on top of Swift") - [Managing views and state in SwiftUI applications](https://www.wearedevelopers.com/videos/183-from-zero-to-mobile-developer-in-45-minutes-with-swiftui) (from "From Zero to Mobile Developer in 45 Minutes With SwiftUI") - [Setting up a native SwiftUI application in Xcode](https://www.wearedevelopers.com/videos/1515-harnessing-apple-intelligence-live-coding-with-swift-for-ios) (from "Harnessing Apple Intelligence: Live Coding with Swift for iOS") - [Adopting Compose gradually in a production legacy app](https://www.wearedevelopers.com/videos/765-migration-to-declarative-ui-in-android-development) (from "Migration to declarative UI in Android development") - [Transitioning native desktop graphics implementations to the web](https://www.wearedevelopers.com/videos/1794-wearedevelopers-live-from-javascript-to-webassembly-high-performance-charting-and-more) (from "WeAreDevelopers LIVE – From JavaScript to WebAssembly, High-Performance Charting and More") ## Related Articles - [Declarative Design and a fresh take on collaboration with developers](https://www.wearedevelopers.com/magazine/595-declarative-design-and-a-fresh-take-on-collaboration-with-developers) - [The HTML Elements That You’re Probably Over-Engineering](https://www.wearedevelopers.com/magazine/646-the-html-elements-that-you-re-probably-over-engineering) - [Dev Digest 103 - Superb Owl Trafficking](https://www.wearedevelopers.com/magazine/388-dev-digest-103-superb-owl-trafficking) - [Dev Digest 118 - not a total recall](https://www.wearedevelopers.com/magazine/452-dev-digest-118-not-a-total-recall) ## Related Jobs - [iOS Engineer, Swift/SwiftUI/Combine (B2C Broker)](https://www.wearedevelopers.com/jobs/ext/1611832-ios-engineer-swift-swiftui-combine-b2c-broker) at **Bitpanda** - [Founding Mobile Engineer (iOS)](https://www.wearedevelopers.com/jobs/ext/1648532-founding-mobile-engineer-ios) at **Almedia** - [Senior Software Engineer, Client Apps Platform](https://www.wearedevelopers.com/jobs/ext/1773893-senior-software-engineer-client-apps-platform) at **GitHub** - [Remote Senior Full-Stack Engineer](https://www.wearedevelopers.com/jobs/ext/683045-remote-senior-full-stack-engineer) at **Edge Impulse** - [Senior Web Designer, Growth](https://www.wearedevelopers.com/jobs/ext/102722-senior-web-designer-growth) at **Intercom, Inc.** - [Remote Senior Full-Stack Engineer](https://www.wearedevelopers.com/jobs/ext/356601-remote-senior-full-stack-engineer) at **Edge Impulse**