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.
Implementieren Sie SwiftUI-Navigationsmuster, einschließlich NavigationStack, NavigationSplitView, Blattpräsentation, tab-basierter Navigation und Deep Linking. Verwenden Sie es beim Erstellen von Push-Navigation, programmatischem Routing, mehrspaltigen Layouts, Modalsheets, Tab-Leisten, universellen Links oder der Handhabung benutzerdefinierter URL-Schemata. Quelle: dpearson2699/swift-ios-skills.