I am using iOS 14, Xcode 12 beta 4 running on both BigSur Beta 4 and Catalina 10.15.6. I created a simple SwiftUI project with this code replacing the default Content View.
If you run this code in Landscape of iPhone 11 or Portrait on iPad 9.7, the very first time the View appears the Secondary view is empty. The user needs to hit the back button to get back to the Primary view.
Surely if no selection is made the Primary View should be immediately visible?
Also in my Code there is an option to add a Selection immediately, unfortunately when I do, I get 2 deep secondary view. The first is an empty view, hitting back brings me to my 'selected' Secondary View.
Should I not be putting my NavigationLinks in a List? The behaviour looks good in other orientations....
If you run this code in Landscape of iPhone 11 or Portrait on iPad 9.7, the very first time the View appears the Secondary view is empty. The user needs to hit the back button to get back to the Primary view.
Surely if no selection is made the Primary View should be immediately visible?
Also in my Code there is an option to add a Selection immediately, unfortunately when I do, I get 2 deep secondary view. The first is an empty view, hitting back brings me to my 'selected' Secondary View.
Code Block struct ContentView: View { @State var tags = ["First", "Second", "Third", "Fourth", "Fifth", "Sixth"] @State var selectedTag: String? = "First" var body: some View { NavigationView { List(tags, id: \.self) { contentItem in // NavigationLink(destination: Text(contentItem + " Content"), // tag: contentItem, // selection: $selectedTag) { // Text(contentItem ) // }.navigationBarTitle("Help") NavigationLink(destination: Text(contentItem + " Content") ) { Text(contentItem) }.navigationBarTitle("Help") } } } }
Should I not be putting my NavigationLinks in a List? The behaviour looks good in other orientations....