Fixing SwiftUI NavigationView on iPad

When moving a NavigationView originally designed only for iPhone to iPad, most likely you will find the view is not visible. This is because in iOS 13+ the default view for NavigationView on iPad is not the master view. We will actually need to swipe from the to see the master view.

The quick fix of this issue is to try to render the UI exactly the same way as on iPhone, which means setting the navigationViewStyle to StackNavigationViewStyle()

NavigationView{
   ....<Your implementation>...
}
.navigationViewStyle(StackNavigationViewStyle())

Leave a ReplyCancel reply