← ClaudeAtlas

swiftui-navigation-architecturelisted

Wire SwiftUI navigation as data on the iOS 26 / macOS 26, Swift 6 baseline: one `@Observable @MainActor` Router in `.environment`, `NavigationStack(path:)` over a typed `Route` enum, `navigationDestination(for:)` at the stack root, `item:`-driven sheets and covers, `.onOpenURL` deep links, `NavigationSplitView`, per-tab paths, `Codable` restoration. Use when wiring an App's navigation, choosing push vs sheet vs `fullScreenCover`, adding deep links or restoration, migrating off `NavigationView`, or asked for a router / coordinator in SwiftUI. Runtime bugs → swiftui-interaction-footguns.
wei18/apple-dev-skills · ★ 19 · Web & Frontend · score 78
Install: claude install-skill wei18/apple-dev-skills
# SwiftUI Navigation Architecture The default navigation shape for Apps on this catalog's baseline (`apple-platform-targets`: iOS 26 / macOS 26, Swift 6 language mode): navigation state is **data** — a typed route enum in one observable router — so flows are unit-testable (assert on `[Route]`), deep-linkable (URL → routes is a pure function), and restorable (routes are `Codable`). ## When to invoke - Wiring navigation in a new App target, or adding a second entry point (deep link, widget tap, notification, tab) - Adding deep links / universal links or state restoration to an existing App - Migrating off `NavigationView` or view-payload `NavigationLink(destination:)` - Asked "how do I do a router / coordinator in SwiftUI?" ## Scope Owns container choice (Stack / SplitView / Tab), route modeling, the router object, deep-link funneling, and restoration. Does NOT own: known interaction bugs in nav components → `swiftui-interaction-footguns`; injecting the services destination views need → `swift-dependency-injection`; nav-chrome accessibility → `ios-accessibility-engineering`. ## Pick the container | App shape | Container | |---|---| | Single drill-down flow (iPhone-first) | `NavigationStack(path:)` | | 2–5 top-level peer sections | `TabView` + one `NavigationStack` per tab, each with its own path | | Source list → detail (iPad / Mac) | `NavigationSplitView`; sidebar selection is router state, the detail column hosts its own `NavigationStack` | Never `NavigationView` in n