Skip to content
Back to skills

Ios Navigation

ASecurity

Here’s a quick-start SwiftUI navigation example using `NavigationStack`, plus a simple deep-link handler at the root: ```swift import SwiftUI enum Route: Hashable { case detail(id: Int) case settings } @main struct MyApp: App { var body: some Scene { WindowGroup { RootView() } } } struct RootView: View { @State private var path = NavigationPath() var body: some View { NavigationStack(path: $path) { List { Button("Open Detail 42") { path.append(Route.detail(id: 42)) } Button("Open Settings") {...

  • 584 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 5, 2026
developmentswift

Security analysis

A100/100

Pro scans all 12 files and shows the line behind each finding

Scanned September 5, 2026

npx -y skills add HoangNguyen0403/agent-skills-standard --skill ios-navigation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ios Navigation?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Ios Navigation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/hoangnguyen0403-ios-navigation-84874f8b/badge)](https://www.skillsdirectory.com/skills/hoangnguyen0403-ios-navigation-84874f8b)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
Here’s a quick-start SwiftUI navigation example using `NavigationStack`, plus a simple deep-link handler at the root:

```swift
import SwiftUI

enum Route: Hashable {
    case detail(id: Int)
    case settings
}

@main
struct MyApp: App {
    var body: some Scene {
        WindowGroup {
            RootView()
        }
    }
}

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

    var body: some View {
        NavigationStack(path: $path) {
            List {
                Button("Open Detail 42") {
                    path.append(Route.detail(id: 42))
                }

                Button("Open Settings") {
                    path.append(Route.settings)
                }
            }
            .navigationTitle("Home")
            .navigationDestination(for: Route.self) { route in
                switch route {
                case .detail(let id):
                    DetailView(id: id)
                case .settings:
                    SettingsView()
                }
            }
        }
        .onOpenURL { url in
            guard url.scheme == "myapp" else { return }

            if url.host == "settings" {
                path.append(Route.settings)
                return
            }

            if url.host == "detail",
               let components = URLComponents(url: url, resolvingAgainstBaseURL: false),
               let idValue = components.queryItems?.first(where: { $0.name == "id" })?.value,
               let id = Int(idValue) {
                path.append(Route.detail(id: id))
            }
        }
    }
}

struct DetailView: View {
    let id: Int

    var body: some View {
        Text("Detail for item \\(id)")
            .navigationTitle("Detail")
    }
}

struct SettingsView: View {
    var body: some View {
        Text("Settings")
            .navigationTitle("Settings")
    }
}
```

Example deep links:

- `myapp://settings`
- `myapp://detail?id=42`

Why this pattern:

- Uses `NavigationStack` with `NavigationPath` for programmatic navigation.
- Handles deep links at the root with `onOpenURL`.
- Avoids force-unwrapping by validating URL parts before pushing routes.

If you need Universal Links too, add the Associated Domains entitlement with your `applinks:` domain and route the incoming URL through the same root handler.

Files in this skill

  • eval-1.baseline.md878 B
  • eval-1.with-skill.md1 KB
  • eval-2.baseline.md1.1 KB
  • eval-2.with-skill.md593 B
  • eval-3.baseline.md1.8 KB
  • eval-3.with-skill.md2.3 KB
  • trigger-1.md174 B
  • trigger-2.md144 B
  • trigger-3.md144 B
  • trigger-4.md153 B
  • trigger-5.md127 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.