0Pricing
SwiftUI Academy · Lesson

Programmatic Navigation Paths

Drive navigation with a navigationDestination path.

Navigating From Code

Sometimes a tap is not enough. After saving a form you may want to jump screens yourself. SwiftUI lets you drive the stack from code. ⚙️

A Path You Control

Give NavigationStack a path binding. This array is the live list of screens currently pushed, and editing it changes navigation instantly.

@State private var path = NavigationPath()
NavigationStack(path: $path) { HomeView() }

All lessons in this course

  1. Pushing Screens with NavigationLink
  2. Passing Data to Detail Views
  3. Toolbar & Navigation Title
  4. Programmatic Navigation Paths
← Back to SwiftUI Academy