navigation-patterns

Guide SwiftUI navigation architectures using NavigationStack, NavigationSplitView, and TabView.

Updated Mar 1, 2026
One-click install
npx skills add https://github.com/mazicimert/RunDom --skill navigation-patterns-mazicimert
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: navigation-patterns
Source: https://github.com/mazicimert/RunDom/tree/main/.claude/skills/ios/navigation-patterns
Command: npx skills add https://github.com/mazicimert/RunDom --skill navigation-patterns-mazicimert

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

SwiftUI navigation patterns across Apple platforms can be complex to implement and maintain; this guide provides a structured approach to building robust navigation architectures.

Core Features & Use Cases

  • Comprehensive guidance on NavigationStack, NavigationSplitView, and TabView usage, including deep linking and programmatic navigation.
  • Best practices, patterns, and anti-patterns for building scalable navigation flows across iOS, iPadOS, and macOS.
  • Use cases spanning simple drill-down, multi-column layouts, and per-tab navigation to preserve state and improve UX.

Quick Start

Study the patterns to implement reliable SwiftUI navigation in real apps.

Frequently Asked Questions about navigation-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement programmatic navigation with NavigationPath in SwiftUI?

Programmatic navigation in SwiftUI uses NavigationPath to manage a navigation stack dynamically. You bind a path array to NavigationStack and append or remove values to control navigation state, enabling complex deep linking flows.

What's the best way to preserve navigation state per tab in a SwiftUI TabView?

To preserve per-tab navigation state in a SwiftUI TabView, use a separate NavigationStack for each tab. This ensures each tab maintains its own independent NavigationPath and drill-down history when switching between tabs.

How do I route deep links to specific views using NavigationStack?

Route deep links by binding a NavigationPath to your NavigationStack and mapping incoming deep link URLs to path values. Register destinations via navigationDestination to ensure the stack resolves the path to the correct view.

When should I use NavigationSplitView instead of NavigationStack?

Use NavigationSplitView for multi-column layouts on iPadOS and macOS, where a sidebar and detail column are needed. Use NavigationStack for single-column drill-down navigation typical in iOS phone apps.

Why is my SwiftUI navigationDestination not rendering the expected view?

SwiftUI navigationDestination fails to render when it is not attached to the correct view hierarchy within the NavigationStack. Ensure the modifier is placed inside the stack content and matches the value type pushed.

Can I use value-based links with NavigationStack across all Apple platforms?

Yes, value-based links work with NavigationStack across iOS, iPadOS, and macOS. You push data conforming to Hashable and use navigationDestination to map the value type to its corresponding destination view.