Post

Replies

Boosts

Views

Activity

Reply to Nested NavigationLinks not working properly in latest SwiftUI
I encounter the same problem and try to find where is wrong, then I remember a few days ago I have implemented this requirement and it worked, so I compare the code I have written and realize I need to add a modifier .isDetailLink(false) after every NavigationLink that is not linked to a final detail view. It works fine for me, hope this can help you. import SwiftUI struct ContentView: View {     var body: some View {         NavigationView {             List(1..<100) { row in                 NavigationLink(destination: InnerListView()) {                     Text("Row \(row)")                 }                 .isDetailLink(false)             }             .navigationTitle("Outer List")         }     } } struct InnerListView: View {     var body: some View {         List(1..<100) { row in             NavigationLink(destination: Text("Details for row \(row)")) {                 Text("Row \(row)")             }             .isDetailLink(false)             .navigationTitle("Inner List")         }     } } struct ContentView_Previews: PreviewProvider {     static var previews: some View {         ContentView()     } }
Jul ’21