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.
Implementa modelli di navigazione SwiftUI tra cui NavigationStack, NavigationSplitView, presentazione di fogli, navigazione basata su schede e collegamenti diretti. Da utilizzare durante la creazione di navigazione push, routing programmatico, layout a più colonne, fogli modali, barre delle schede, collegamenti universali o gestione di schemi URL personalizzati. Fonte: dpearson2699/swift-ios-skills.