Back to Skills

swiftui-navigation

verified

Implement SwiftUI navigation with NavigationStack, NavigationSplitView, deep linking, and programmatic routing. Use when building navigation flows, handling deep links, implementing tab bars, or creating multi-column layouts.

View on GitHub

Marketplace

fusengine-plugins

fusengine/agents

Plugin

fuse-swift-apple-expert

development

Repository

fusengine/agents

plugins/swift-apple-expert/skills/swiftui-navigation/SKILL.md

Last Verified

January 22, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/fusengine/agents/blob/main/plugins/swift-apple-expert/skills/swiftui-navigation/SKILL.md -a claude-code --skill swiftui-navigation

Installation paths:

Claude
.claude/skills/swiftui-navigation/
Powered by add-skill CLI

Instructions

# SwiftUI Navigation

## NavigationStack (iOS 16+)

```swift
// Type-safe routing with enum
enum AppRoute: Hashable, Codable {
    case home
    case profile(userId: String)
    case settings
    case detail(item: Item)
}

struct ContentView: View {
    @State private var path = NavigationPath()

    var body: some View {
        NavigationStack(path: $path) {
            HomeView()
                .navigationDestination(for: AppRoute.self) { route in
                    destinationView(for: route)
                }
        }
    }

    @ViewBuilder
    private func destinationView(for route: AppRoute) -> some View {
        switch route {
        case .home: HomeView()
        case .profile(let id): ProfileView(userId: id)
        case .settings: SettingsView()
        case .detail(let item): DetailView(item: item)
        }
    }

    // Programmatic navigation
    func navigateTo(_ route: AppRoute) {
        path.append(route)
    }

    func popToRoot() {
        path.removeLast(path.count)
    }
}
```

## Deep Linking

```swift
struct ContentView: View {
    @State private var path = NavigationPath()

    var body: some View {
        NavigationStack(path: $path)
            .onOpenURL { url in
                handleDeepLink(url)
            }
    }

    private func handleDeepLink(_ url: URL) {
        guard let routes = DeepLinkParser.parse(url) else { return }
        path = NavigationPath()
        for route in routes {
            path.append(route)
        }
    }
}

struct DeepLinkParser {
    static func parse(_ url: URL) -> [AppRoute]? {
        guard url.scheme == "myapp" else { return nil }

        switch url.host {
        case "profile":
            let id = url.pathComponents.dropFirst().first ?? ""
            return [.profile(userId: id)]
        case "settings":
            return [.settings]
        default:
            return nil
        }
    }
}
```

## NavigationSplitView (iPad/Mac)

```swift
struct MainView: View {
    @State private var

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
2425 chars