skills/ios/navigation-patterns/SKILL.md
SwiftUI navigation architecture patterns including NavigationStack, NavigationSplitView, TabView, programmatic navigation, and custom transitions. Use when reviewing or building navigation, fixing navigation bugs, or architecting app flow.
npx skillsauth add rshankras/claude-code-apple-skills navigation-patternsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Comprehensive guide for SwiftUI navigation architecture on iOS, iPadOS, and macOS. Covers the modern navigation APIs (iOS 16+/macOS 13+) with patterns for common and advanced use cases.
Use this to pick the right navigation container:
What is the app structure?
│
├─ Flat sections (3-5 top-level areas)
│ └─ TabView → see tab-view.md
│
├─ Hierarchical drill-down (list → detail)
│ └─ NavigationStack → see navigation-stack.md
│
├─ Sidebar + content (macOS / iPad)
│ ├─ Two columns → NavigationSplitView → see navigation-split-view.md
│ └─ Three columns → NavigationSplitView → see navigation-split-view.md
│
└─ Combined (tabs with drill-down, sidebar with stacks)
└─ TabView + NavigationStack per tab
OR NavigationSplitView + NavigationStack in detail
| Pattern | Container | Min OS | Reference |
|---------|-----------|--------|-----------|
| Simple drill-down | NavigationStack | iOS 16 | navigation-stack.md |
| Value-based links | NavigationLink(value:) | iOS 16 | navigation-stack.md |
| Programmatic push/pop | NavigationPath | iOS 16 | programmatic-navigation.md |
| Pop to root | path = NavigationPath() | iOS 16 | programmatic-navigation.md |
| State restoration | NavigationPath.CodableRepresentation | iOS 16 | programmatic-navigation.md |
| Two-column layout | NavigationSplitView | iOS 16 | navigation-split-view.md |
| Three-column layout | NavigationSplitView | iOS 16 | navigation-split-view.md |
| Column visibility | NavigationSplitViewVisibility | iOS 16 | navigation-split-view.md |
| Tab bar | TabView | iOS 13 | tab-view.md |
| Customizable tabs | Tab + TabView | iOS 18 | tab-view.md |
| Sidebar tabs (iPad) | .tabViewStyle(.sidebarAdaptable) | iOS 18 | tab-view.md |
| Zoom transition | .navigationTransition(.zoom) | iOS 18 | navigation-transitions.md |
| Custom transitions | NavigationTransition | iOS 18 | navigation-transitions.md |
The container APIs above decide how navigation is built; these rules decide whether it's designed right.
Tab bars
Push vs modal
Wayfinding
Nearly every app is one of these three shapes. Pick one per scene, then lift its navigation state.
NavigationStack(path:) + NavigationLink(value:) + .navigationDestination(for:). Pop-to-root is path.removeAll(); a deep link is just assigning the path.NavigationSplitView + List(selection:) in each leading column. Value links auto-drive the next column's selection, so programmatic navigation is setting the selection value.NavigationSplitView with a NavigationStack(path:) inside the detail column: sidebar selection picks the collection, the stack drills into it.Rules that make the recipes hold up:
NavigationSplitView even for iPhone-first apps — it auto-collapses to a single stack in compact width, and iPad/Mac layouts come free.path/selection per container. That single source of truth is what makes pop-to-root, deep links, and restoration one-line operations.State restoration: persist through @SceneStorage("navigation") plus a .task that restores once on appear, then streams subsequent path changes back into storage.
Read the user's code or requirements to determine:
Based on the need, read from this directory:
navigation-stack.md — NavigationStack, NavigationLink, navigationDestinationnavigation-split-view.md — Two/three column layouts, column control, adaptive behaviortab-view.md — TabView, iOS 18 customizable tabs, sidebar modeprogrammatic-navigation.md — NavigationPath, state restoration, coordinators, pop-to-rootnavigation-transitions.md — Custom push/pop transitions (iOS 18+)Apply patterns from the reference files. Check for common mistakes:
NavigationView instead of NavigationStack/NavigationSplitViewNavigationLink(destination:) instead of NavigationLink(value:) + .navigationDestinationNavigationStack in a sidebar/content column of NavigationSplitView (a stack belongs only in the detail column — Recipe 3).navigationDestination attached inside a lazy container (destination may never register).navigationDestination registration for a value type@State or not in the right scopeNavigationPath for programmatic controlgenerators/deep-linking/ skilldesign/animation-patterns/transitions.mdmacos/ui-review-tahoe/swiftui-macos.mddevelopment
US web checkout via the StoreKit External Purchase Link entitlement — currently 0% Apple commission (litigation ongoing), how to ship it safely, and how to architect for a commission flip so a future ruling is a config change, not a rewrite. Use when adding external purchase links, weighing web checkout vs IAP, or planning US-storefront pricing strategy.
tools
Revenue beyond the single-app price tag — own-app bundles, Family Sharing as a conversion lever, cross-developer bundles & suites, and institutional licensing via Group Purchases / Apple School & Business Manager. Use when a developer has multiple apps, a subscription worth sharing, complementary indie partners, or school/clinic/business buyers.
testing
Run a structured accessibility audit on an iOS/macOS app — automated XCUITest audits, Accessibility Inspector, manual VoiceOver/Dynamic Type passes, and App Store Accessibility Nutrition Label evaluation. Use before release, when preparing Nutrition Label declarations, or for EU Accessibility Act compliance.
tools
Stage-by-stage audit of an app's App Store growth machinery against a 54-item P0–P9 playbook — every item scored from an App Store Connect MCP call, a codebase check, or an explicit question to the user, then routed to the skill or command that fixes it. Read-only on App Store Connect. Use for a growth audit or scorecard, a pre-launch growth plan, a quarterly re-audit, or "which growth levers am I missing."