SwiftUI. Initial screen is empty and with back button on iPad

Artem Mihelson
Mar 29, 2022

Hi, this is another short How-To article explaining how to fix empty initial screen opened on iPad.

I have faced the issue when developed an WidgetLingo app (https://apps.apple.com/us/app/widgetlingo/id1560884784) when app started on empty screen with back button in top left corner.

This issue usually reproduces when you use NavigationView as a root View. By default, navigation views appear with multiple columns in wider environments, like iPad in landscape orientation. So if you intend to have single column view you need to apply the following modifier to the NavigationView:

struct ExampleView: View {
var body: some View {
NavigationView {
EmptyView()
}
.navigationViewStyle(StackNavigationViewStyle())
}
}

That’s it. Happy coding!

--

--

Artem Mihelson

Founder of Pills.Kit, Proximodoro and WidgetLingo apps