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
- Pushing Screens with NavigationLink
- Passing Data to Detail Views
- Toolbar & Navigation Title
- Programmatic Navigation Paths