SwiftUI NavigationView on the iPad Pro

You can override the default splitView used on iPad, by having the NavigationView display the same stacked view you see on iPhone, by setting .navigationViewStyle(StackNavigationViewStyle())

Quite helpful during development and debugging, and when you have not developed the detailedView() yet.


In my case what make the difference was using StackNavigationViewStyle and no padding were needed.

NavigationView {
  ...
}
.navigationViewStyle(StackNavigationViewStyle())

Slide the drawer from the left side of the screen.

If you would to remove the drawer and have it constant, you can do the following (note the padding is what makes the drawer constant):

.navigationViewStyle(DefaultNavigationViewStyle())
        .padding(0)

or

.navigationViewStyle(DoubleColumnNavigationViewStyle())
        .padding(0)

Note: This does not currently work perfectly with all iPad views. For example on the iPad 9.7in, the above padding(0) would make the portrait view have the list, but the landscape view have the slideout. This would also not work correctly on the iPad 12.9in. If you don't have the padding included, it works in landscape on the 9.7in, but not in portrait.