name: uikit-navigation description: Use when building or reviewing UIKit navigation controllers, modal presentations, custom transitions, or coordinator routing.
UIKit Navigation
Review and write UIKit navigation code for correct push/pop flows, modal presentations, custom transitions, and coordinator-based architecture.
Responsibility
Owns: UINavigationController (push, pop, toolbar, large titles), modal presentation styles, UIPresentationController, UIViewControllerTransitioningDelegate, UIViewControllerAnimatedTransitioning, coordinator pattern, UIAdaptivePresentationControllerDelegate.
Does NOT own: SwiftUI NavigationStack (swiftui-patterns skill), tab bars in SwiftUI, view controller lifecycle (uikit-fundamentals skill), SwiftUI bridging (uikit-interop skill).
Core Principles
- Push for drill-down, modals for tasks. Push when navigating deeper in a hierarchy. Present modally for self-contained tasks (compose, settings, alerts).
- Presentation styles matter.
.automatic(default) is.pageSheeton iPhone/iPad. Use.fullScreenonly when the underlying content shouldn't be visible..formSheetfor compact dialogs on iPad. - Large titles for top-level screens. Set
navigationItem.largeTitleDisplayMode = .alwaysfor root,.neverfor detail. The navigation bar handles the transition. - Custom transitions need three objects. A
UIViewControllerTransitioningDelegatethat vends anUIViewControllerAnimatedTransitioning(and optionally aUIPresentationController). - Coordinator pattern for flow management. Coordinators own navigation controllers and handle routing. View controllers fire delegate methods; they don't know about the next screen.
- Handle dismissal. Implement
presentationControllerDidDismiss(_:)on the adaptive presentation delegate to clean up when users swipe to dismiss a.pageSheet.
References
references/uikit-navigation-patterns.md— Push/pop, modals, custom transitions, coordinators