With NavigationView
being the root of UIHostingController
, the below code shows split view for iPad.
struct ContentView: View {
var body: some View {
NavigationView {
Text("Hello")
.navigationBarTitle("Home")
}
}
}
With the above code it shows split view on iPad. How can I still use the NavigationView
and get rid of split view for iPad , as I am looking to have a List and on tap of which it should push another view?
.navigationViewStyle
modifier must be attached directly to theNavigationView
, as shown here. I originally had it attached to my inner view and it did not work. β Sampler