swiftui-nav

Guide SwiftUI navigation architecture with NavigationStack, NavigationSplitView, and TabView.

1.1k|81|Updated Nov 30, 2025
One-click install
npx skills add https://github.com/CharlesWiltgen/Axiom --skill swiftui-nav
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swiftui-nav
Source: https://github.com/CharlesWiltgen/Axiom/tree/main/.claude-plugin/plugins/axiom/skills/swiftui-nav
Command: npx skills add https://github.com/CharlesWiltgen/Axiom --skill swiftui-nav

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Guidance on navigation architecture, deep linking, coordinators, and code reviews for SwiftUI navigation.

Core Features & Use Cases

  • Decision trees for NavigationStack vs NavigationSplitView vs TabView.
  • Programmatic navigation with NavigationPath and deep links.
  • Coordinator/router pattern guidance.

Quick Start

Decide between NavigationStack and NavigationSplitView for a given app structure.

Frequently Asked Questions about swiftui-nav

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

FAQPage Schema
How do I choose between NavigationStack and NavigationSplitView in SwiftUI?

NavigationStack suits linear, single-path flows on phones; NavigationSplitView handles multi-column layouts for tablets and macOS. Choose based on your app's structure and target devices—NavigationStack for sequential navigation, NavigationSplitView for sidebar + detail patterns.

What causes navigation state corruption in SwiftUI apps?

Navigation state corruption occurs when NavigationPath loses sync with your data model, especially across app restarts or deep link handling. Using Codable NavigationPath and MainActor isolation prevents inconsistencies and ensures reliable state restoration.

How do I implement deep links and URL routing in SwiftUI?

Deep links map URLs to NavigationPath destinations using the onOpenURL modifier. Configure routing by parsing URL components, validating state, and pushing destinations onto NavigationPath programmatically to enable reliable deep link handling.

What's the best way to handle per-tab navigation state in SwiftUI?

Use TabView with separate NavigationStack instances per tab, each maintaining independent NavigationPath state. This prevents state leakage between tabs and ensures users return to their position within each tab after switching.

When should I use the coordinator pattern with SwiftUI navigation?

Use coordinators to centralize navigation logic, decouple views from routing decisions, and manage complex state flows across screens. Coordinators work on iOS 18+ and simplify code review and testing of navigation decisions.

Why should I avoid deprecated navigation APIs in SwiftUI?

Deprecated APIs like NavigationView lack support for modern features such as Codable path persistence, MainActor isolation, and reliable deep linking. Modern NavigationStack and NavigationSplitView prevent common bugs and align with current SwiftUI best practices.