# swiftui-navigation

Provides SwiftUI navigation architectures, covering typed stacks, multi-column layouts, sheets, and tabs. Useful when structuring navigation state across iOS and macOS apps.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 4400 installs · ★ 1237
- Author: dpearson2699
- License: LicenseRef-Unknown · policy=link-only · description only; the file stays with the author
- Source: https://github.com/dpearson2699/swift-ios-skills/tree/HEAD/skills/swiftui-navigation/SKILL.md
- Updated: 2026-07-31
- HTML: https://affpapa.org/en/nevibecode/skills/swiftui-navigation

## What it does

This skill guides the agent to implement programmatic navigation using `NavigationStack` bound to a typed `[Route]` array. Routes rely on a `Hashable` enum mapped with `.navigationDestination(for:)`, guaranteeing compile-time safety. To avoid cluttered views, an app router object holds stack and modal state, injected across subviews using SwiftUI environment modifiers.

For split layouts on iPad and Mac, it provides standard `NavigationSplitView` setups and manual `HStack` splits conditioned on `horizontalSizeClass`. Sheet presentations prioritize `.sheet(item:)` over boolean flags, combining them with `.presentationSizing` controls and `.interactiveDismissDisabled` to protect unsaved form edits.

The guidelines target iOS 26+ with Swift 6.3, remaining compatible down to iOS 17. Projects locked to earlier OS releases cannot use these patterns because they drop legacy `NavigationView` entirely.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swiftui-navigation -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/swiftui-navigation/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/swiftui-navigation/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swiftui-navigation -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/swiftui-navigation/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swiftui-navigation -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/swiftui-navigation/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install dpearson2699/swift-ios-skills swiftui-navigation
```

2. **Manually: put the files in place**
- File: `.github/skills/swiftui-navigation/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swiftui-navigation -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/dpearson2699/swift-ios-skills --path skills/swiftui-navigation
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/swiftui-navigation/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swiftui-navigation -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/dpearson2699/swift-ios-skills/tree/HEAD/skills/swiftui-navigation/SKILL.md

## When to use it
- build type-safe programmatic navigation using a route enum
- isolate navigation stacks inside separate tab items
- implement multi-column interfaces with NavigationSplitView
- guard unsaved sheet changes against accidental interactive dismissal

## Example prompts
- Set up a router-based NavigationStack using a custom route enum
- Create a multi-column layout using NavigationSplitView for iPad
- Configure a sheet presentation with custom presentationSizing

## Similar
- [swiftui-ui-patterns](https://affpapa.org/en/nevibecode/skills/swiftui-ui-patterns.md) — skill · 114 installs
- [swiftui-patterns](https://affpapa.org/en/nevibecode/skills/affaan-m-swiftui-patterns.md) — skill · 4600 installs
- [swiftui-motion](https://affpapa.org/en/nevibecode/skills/swiftui-motion.md) — skill · 943 installs
- [swiftui-whats-new-27](https://affpapa.org/en/nevibecode/skills/swiftui-whats-new-27.md) — skill · 737 installs
- [guide-swiftui-animations](https://affpapa.org/en/nevibecode/skills/guide-swiftui-animations.md) — skill · 347 installs
- [swiftui-specialist](https://affpapa.org/en/nevibecode/skills/swiftui-specialist.md) — skill · 864 installs

From the same set: [dpearson2699/swift-ios-skills](https://affpapa.org/en/nevibecode/by/dpearson2699/swift-ios-skills.md) — 86 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
