SwiftUI
Navigation state, re-render debugging, UIKit interop, and building components that scale.
- How do you mix UIKit and SwiftUI safely? UIHostingController embeds SwiftUI in UIKit and UIViewRepresentable embeds UIKit in SwiftUI, but the real discipline is one clear owner for shared state.
- What are SwiftUI's current limitations? Sheet-presentation keyboard focus timing, rich text editing, and exotic gesture composition with Canvas still lag native UIKit and AppKit in 2026.
- How do you debug unexpected SwiftUI re-renders? Self._printChanges() reveals which property triggered a body re-evaluation, and a broadly-scoped observable object is usually the real cause of the churn.
- How do you manage navigation state in SwiftUI? NavigationStack turns navigation into state via a NavigationPath owned by a router, though its type erasure often pushes teams toward a plain Route array.
- How do you design reusable SwiftUI components? Reusable components lean on ViewBuilder for structure and custom ButtonStyle or ViewModifier types for optional behavior, extracted only when needed.
- How do you avoid unnecessary view updates? Giving each view the smallest dependency surface, via @Observable's field tracking and passing specific fields instead of whole objects, cuts updates.