I have a two column NavigationSplitView with a linked NavigationSplitViewVisibility variable. On the iPad everything works as expected. Tapping on the “Go to Detail View” in the sidebar will go to the Detail view. However on the iPhone nothing happens.
Any ideas how to resolve this.
Thanks
Here is the code:
struct ContentView: View {
@State var visibility:NavigationSplitViewVisibility = .all
var body: some View {
NavigationSplitView( columnVisibility:$visibility) {
Text("Go to Detail View" )
.onTapGesture {
visibility = .detailOnly
}
} detail: {
Text( "Show Sidebar")
.onTapGesture {
visibility = .all
}
}
}
}