Structure¶
StackNavigationViewStyle¶
A navigation view style represented by a view stack that only shows a single top view at a time.¶
Declaration¶
struct StackNavigationViewStyle : NavigationViewStyle
Overview¶
Use this style with the navigationViewStyle(_:) view modifier to change a NavigationView to use a stack style.
For example, below we override the default style of Mac Catalyst to use stacking:
struct ExampleView: View {
var destination: some View {
Text("I'm stacked on the pancakes 📚")
.navigationTitle("Second Screen")
}
var body: some View {
NavigationView {
NavigationLink(destination: destination) {
Text("Stack the second screen! 🥞")
}
}
.navigationViewStyle(StackNavigationViewStyle())
}
}

Availability¶
iOS 13.0+
tvOS 13.0+
watchOS 7.0+
Topics¶
Initializer¶
init() Creates a stack navigation view style.