NavigationSplitView – multicolumn navigation
NavigationSplitView
is a view that presents views in two or three columns, where selections in leading columns control presentations in subsequent columns.
On large-screen devices, such as iPad and Mac, NavigationSplitView
will represent detail-view navigation on multiple columns to better exploit large screens but will automatically default to a normal navigation stack when the screen width is compact (normal iPhone width in vertical format).
The simplest multicolumn view you can obtain in this way is simply a two-column static view, like in the following code fragment, which would work on an iPad:
struct ContentView: View { var body: some View { NavigationStack{ NavigationSplitView { ...