Concept

NavigationStack is used in SwiftUI for push-based navigation.

It allows apps to:

move from one screen to another
push views onto a stack
go deeper into content

Core flow:

View → Navigation Trigger → Destination View

What It Does

NavigationStack creates a navigation container for your views.

Inside it, SwiftUI can:

push a new screen
show a back button
maintain navigation history
match values to destinations

This is useful for:

detail pages
step-by-step flow
hierarchical navigation

Basic Structure

NavigationStack {
    ContentView()
}

This means the content inside the stack can participate in navigation.


NavigationLink Inside NavigationStack

A NavigationLink is commonly used inside NavigationStack to move to another screen.