Overview
- I have a 3 column
NavigationSplitView
- On iPad I would like to detect if the sidebar (red) / content (green) is a slide over
- I don't want to rely on orientation as it is possible to have multiple apps side by side and that can change the view size
Questions:
- On iPad, how can I detect if sidebar (red) / content (green) is a slide over?
- Or is there an alternate approach?
Code:
struct ContentView: View {
@State private var splitViewVisibility = NavigationSplitViewVisibility.automatic
var body: some View {
NavigationSplitView(columnVisibility: $splitViewVisibility) {
Color.red
} content: {
Color.green
} detail: {
Color.blue
}
}
}
Screenshot
Slide over
Not Slide Over