I'm experimenting with SwiftUI's new support for multi-column sidebar layouts. I know that I can do something like this:
struct SidebarContentView: View {
var body: some View {
NavigationView {
List {
ForEach(0...5, id: \.self) { i in
Text("\(i)")
}
}
.listStyle(SidebarListStyle())
.navigationTitle("List 1")
List {
ForEach(0...5, id: \.self) { i in
Text("\(i)")
}
}
.navigationTitle("List 2")
Text("Hello world")
.font(.largeTitle)
.navigationTitle("Content")
}
.navigationViewStyle(DoubleColumnNavigationViewStyle())
}
}
To create my 3-column layout (2 navigation columns and then a larger content view), but initially that results in a view that looks like this:
I would have to hit the Back button in order to get the layout to look like this:
What I'd really like to have is all 3 columns be visible at the same time, without the need to hit a back button or anything, at least when an iPad is in landscape mode. An example would look like this:
Can anyone explain how I can achieve such a layout? I would want it to be active when my app runs on macOS or when on an iPad in landscape mode. In portrait mode I would be fine with the navigation style shown in the first screenshot, but want all panes to be visible otherwise. Any ideas?