Navigation patterns for SwiftUI apps targeting iOS 26+ with Swift 6.2. Covers push navigation, multi-column layouts, sheet presentation, tab architecture, and deep linking. Patterns are backward-compatible to iOS 17 unless noted.
Use NavigationStack with a NavigationPath binding for programmatic, type-safe push navigation. Define routes as a Hashable enum and map them with .navigationDestination(for:).
Router pattern: For apps with complex navigation, use a router object that owns the path and sheet state. Each tab gets its own router instance injected via .environment(). Centralize destination mapping with a single .navigationDestination(for:) block or a shared withAppRouter() modifier.
Implémentez des modèles de navigation SwiftUI, notamment NavigationStack, NavigationSplitView, une présentation de feuille, une navigation par onglets et des liens profonds. À utiliser lors de la création de navigation push, de routage programmatique, de mises en page multi-colonnes, de feuilles modales, de barres d'onglets, de liens universels ou de gestion de schémas d'URL personnalisés. Source : dpearson2699/swift-ios-skills.