home / skills / hoangnguyen0403 / agent-skills-standard / ios-navigation
This skill guides iOS navigation in SwiftUI using NavigationStack and deep linking, improving app reliability and user flow.
npx playbooks add skill hoangnguyen0403/agent-skills-standard --skill ios-navigationReview the files below or copy the command above to add this skill to your agents.
---
name: iOS Navigation
description: SwiftUI navigation and deep linking using NavigationStack and Universal Links.
metadata:
labels: [ios, swiftui, navigation, deep-linking, universal-links]
triggers:
files: ['**/*View.swift', '**/*App.swift']
keywords:
[
NavigationStack,
NavigationLink,
onOpenURL,
universalLink,
NSUserActivity,
]
---
# iOS Navigation (SwiftUI)
## **Priority: P2 (OPTIONAL)**
SwiftUI path-based navigation and deep linking.
## Guidelines
- **Stack**: Use `NavigationStack` (iOS 16+) with `NavigationPath` for programmatic control.
- **Deep Links**: Handle `onOpenURL` at the Root View (`WindowGroup`).
- **Universal Links**: Configure Associated Domains (`applinks`) in Entitlements.
- **Tabs**: Maintain separate `NavigationStack` instances per `TabItem`.
[Navigation Patterns](references/swiftui-navigation.md)
## Anti-Patterns
- **No Force Unwrapping**: Use `guard let` when parsing URL components.
- **No Broken Back Stack**: Ensure valid path state before appending destinations.
- **No Missing Validation**: Check content availability before deep-link navigation.
## Related Topics
ios-design-system | ios-notifications | mobile-ux-core
This skill teaches SwiftUI navigation and deep linking patterns focused on NavigationStack, NavigationPath, and Universal Links. It packages clear, actionable guidance for building predictable in-app navigation, handling external URLs, and maintaining per-tab navigation state. The goal is reliable programmatic control and safe URL handling across iOS 16+ apps.
It recommends using NavigationStack with a NavigationPath for programmatic pushes, pops, and state restoration. Deep links are parsed and routed at the root WindowGroup via onOpenURL, while Universal Links require applinks entries in the entitlements. Tabs should own their own NavigationStack so each tab preserves an independent back stack.
Should I use NavigationView or NavigationStack?
Prefer NavigationStack on iOS 16+ for programmatic control and NavigationPath; NavigationView is legacy and has limited path-based APIs.
Where do I handle incoming URLs?
Handle incoming URLs at the root WindowGroup with onOpenURL so all routing decisions and state checks happen centrally.