Implements SwiftUI navigation patterns: NavigationStack, NavigationSplitView, sheets, tabs, and deep linking. Covers programmatic routing, multi-column layouts, modal presentation, and URL scheme handling for iOS apps.
Ships in all-ios-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Navigation patterns for SwiftUI apps targeting iOS 26+ (iOS 27 additions in references/ios27-toolbars-tabs.md) with Swift 6.4 or later. 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 typed [Route] binding for programmatic push navigation. Define routes as a Hashable enum and map them with .navigationDestination(for:); this keeps the path compile-time checked. Use NavigationPath only when one stack must hold heterogeneous route value types.
enum Route: Hashable { case item(id: Item.ID) }
NavigationStack(path: $path) {
List(items) { item in
NavigationLink(value: Route.item(id: item.id)) { ItemRow(item: item) }
}
.navigationDestination(for: Route.self) { route in
switch route { case .item(let id): DetailView(itemID: id) }
}
.navigationTitle("Items")
}
Programmatic navigation: path.append(.item(id:)) pushes, path.removeLast() pops one, and path = [] pops to root.
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.
See references/navigationstack.md for full router examples including per-tab stacks, centralized destination mapping, generic tab routing, and the manual-HStack custom split column.
Use NavigationSplitView for sidebar-detail layouts on iPad and Mac. It falls back to stack navigation on iPhone.
NavigationSplitView {
List(items, selection: $selectedItem) { item in
NavigationLink(value: item) { ItemRow(item: item) }
}
} detail: {
if let item = selectedItem { ItemDetailView(item: item) }
else { ContentUnavailableView("Select an Item", systemImage: "sidebar.leading") }
}
For a custom multi-column layout (e.g., a dedicated notification column independent of selection), use a manual HStack split with horizontalSizeClass checks. See manual-HStack custom split column. Use NavigationSplitView when you want a standard system layout with minimal customization.
Prefer .sheet(item:) over .sheet(isPresented:) when state represents a selected model. Sheets should own their actions and call dismiss() internally.
Presentation sizing (iOS 18+): Control sheet dimensions with .presentationSizing: .automatic (platform default), .page (paper size), .form (form-style UI), .fitted (content ideal size). Fine-tune with .fitted(horizontal:vertical:) and .sticky(horizontal:vertical:).
.sheet(item: $selectedItem) { item in
EditItemSheet(item: item).presentationSizing(.form)
}
Dismissal protection: On iOS/iPadOS, use .interactiveDismissDisabled(hasUnsavedChanges) and provide explicit Save/Discard actions inside the sheet. On macOS 15+, use .dismissalConfirmationDialog("Discard?", shouldPresent: hasUnsavedChanges). Route every programmatic close through the same save/validate/discard gate; interactiveDismissDisabled guards interactive dismissal only.
Enum-driven sheet routing: Define an Identifiable SheetDestination enum, store it on the router, and map it with a shared view modifier so any child can present sheets without prop-drilling. See references/sheets.md for the full centralized sheet routing pattern.
Use the Tab API with a selection binding for scalable tab architecture. Each tab should wrap its content in an independent NavigationStack.
TabView(selection: $selectedTab) {
Tab("Home", systemImage: "house", value: .home) {
NavigationStack { HomeView() }
}
Tab("Search", systemImage: "magnifyingglass", value: .search) {
NavigationStack { SearchView() }
}
}
Route selection changes through a function to intercept special tabs (e.g., compose) that should trigger an action instead of changing selection.
Tab(value:role:) with .search -- marks a dedicated search tab with system default search title, icon, and pinning behavior.tabViewSearchActivation(_:) -- controls search tab activation and deactivation behavior.tabBarMinimizeBehavior(_:) -- .onScrollDown, .onScrollUp, .never (iPhone only).tabViewSidebarHeader/Footer -- customize sidebar sections on iPadOS/macOS.tabViewBottomAccessory { } -- attach content below the tab bar (e.g., Now Playing bar)TabSection -- group tabs into sidebar sections with .tabPlacement(.sidebarOnly)See references/tabview.md for full TabView patterns including custom bindings, dynamic tabs, and sidebar customization.
Use parse → validate → commit. Parse into a typed route without mutating navigation; validate scheme/host/path, identifier shape, authorization, and destination existence; then update tab/path atomically. Invalid links must leave the current navigation unchanged.
Universal links let iOS open your app for standard HTTPS URLs. They require an Apple App Site Association (AASA) file at /.well-known/apple-app-site-association and an Associated Domains entitlement (applinks:example.com). Handle Universal Links and custom URL schemes in SwiftUI with .onOpenURL, routing into the shared router.
Register schemes in Info.plist under CFBundleURLTypes. Handle with .onOpenURL. Prefer universal links over custom schemes for publicly shared links -- they provide web fallback and domain verification.
Advertise activities with .userActivity() and receive Handoff or other user activities with .onContinueUserActivity(). Declare activity types in Info.plist under NSUserActivityTypes. Set isEligibleForHandoff = true and provide a webpageURL as fallback.
See references/deeplinks.md for full examples of AASA configuration, router URL handling, custom URL schemes, and NSUserActivity continuation.
NavigationView -- use NavigationStack or NavigationSplitView.sheet(isPresented:) when state represents a model -- use .sheet(item:) insteadHashable route data@Observable router objects inside other @Observable objectsTab(value:) with TabView(selection:) over the older .tabItem { } APItabBarMinimizeBehavior works on iPad -- it is iPhone only.presentationSizing(.form) instead@MainActor on router classes -- required for Swift 6 concurrency safetyNavigationStack used (not NavigationView)NavigationStack with independent pathHashable with stable identifiers.navigationDestination(for:) maps all route types.sheet(item:) preferred over .sheet(isPresented:)@MainActor and @ObservableTab(value:) with bindingswiftui-patterns skillswiftui-layout-components skillWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/all-ios-skills:swiftui-navigationfrom all-ios-skills
npx claudepluginhub thienqo/ios-skills --plugin all-ios-skills95 skills in this plugin
/accessorysetupkitDiscover and configure Bluetooth and Wi-Fi accessories using AccessorySetupKit. Use when presenting a privacy-preserving accessory picker, defining discovery descriptors for BLE or Wi-Fi devices, handling accessory session events, migrating from CoreBluetooth permission-based scanning, or setting up accessories without requiring broad Bluetooth permissions./activitykitBuild or review Live Activities and Dynamic Island experiences with ActivityKit, including lifecycle, layouts, push updates, and scheduled delivery. Use for time-sensitive Lock Screen or Dynamic Island state; route ordinary widgets to widgetkit./adattributionkitMeasure ad effectiveness with privacy-preserving attribution using AdAttributionKit. Use when registering ad impressions, handling attribution postbacks, updating conversion values, implementing re-engagement attribution, configuring publisher or advertiser apps, or replacing SKAdNetwork with AdAttributionKit for ad measurement.Other plugins' skills for the same job