At the top level, my app has a tab bar.
the second tab's root view is a list view. When a user taps an item in the list, the app presents a detail view for the list item.
The problem I'm currently having is the behaviour the first time the user taps the second tab's button in the tab bar (when running on an iPad in portrait.
There is a navBar at the top, but the screen is otherwise empty. (tapping the left button on the navBar shows the list view, which allows the user to select an item which populates the main detail view)
Is there some way (in swfitUI) to force the list view to show when in portrait? Alternatively/additionally, is there someway to present some instructional view in the otherwise empty view. (It doesn't appear to be creating a standard detail view here until the user exposes the list and picks an item)
Here is some sample code that demonstrates what I'm describing.
thanks in advance for any assistance!
Mike
the second tab's root view is a list view. When a user taps an item in the list, the app presents a detail view for the list item.
The problem I'm currently having is the behaviour the first time the user taps the second tab's button in the tab bar (when running on an iPad in portrait.
There is a navBar at the top, but the screen is otherwise empty. (tapping the left button on the navBar shows the list view, which allows the user to select an item which populates the main detail view)
Is there some way (in swfitUI) to force the list view to show when in portrait? Alternatively/additionally, is there someway to present some instructional view in the otherwise empty view. (It doesn't appear to be creating a standard detail view here until the user exposes the list and picks an item)
Here is some sample code that demonstrates what I'm describing.
thanks in advance for any assistance!
Mike
Code Block import SwiftUI struct ContentView: View { var body: some View { TabView(){ FirstTabView() .tabItem { Text("First") } .tag(0) SecondTabView() .tabItem { Text("Second") } .tag(1) } } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() .previewDevice(PreviewDevice(rawValue: "iPad8,1")) } } struct FirstTabView: View { var body: some View { Text("First View") } } struct SecondTabView: View { var body: some View { NavigationView { NavigationLink(destination: Text("Detail View")) { Text("SummaryView") } .navigationBarTitle("Navigation") } } }