Navigationlink not working well

My app is an master-detail map, all seems to be working ok but when I enter to the detail view, I go back to the master view, and then I try to go again to the same detail view. The second time the cell stay in a gray color and the app doesn't enter into the detail view.


If you create a new master-detail project and you execute the template with no changes, you get the same bad behaviour.

I'have tried with both xcode 11.2.1 and xcode 11.3 with no result.

Replies

Hi,

Please provide some code so we can assist you better.


Do you see the problem in the simulator, a real device, or both?


Dan Uff

Did you figure this out ? I have the same issue

I'm also experiencing the same behavior with iOS 13.3 beta 3, and both Xcode 11.2.1 and the latest Xcode 11.3 beta (although it doesn't happen in the live preview in Xcode). My app uses a tab view, and switching to another tab or selecting a different navigation link clears the issue for the previously tapped navigation link. Here's an example from my project:

struct Option: Identifiable {
    var id = UUID()
    
    var title = String()
    var icon: Image
    
}


let options: [Option] = [Option(title: "Account", icon: accountImage), Option(title: "Managers", icon: managersImage), Option(title: "Notifications", icon: notificationsImage), Option(title: "Keys", icon: keysImage)]



struct SettingsView: View {
    var body: some View {
        NavigationView {
            
            List (options) { option in
                NavigationLink(destination: Text(option.title)) {
                    HStack(alignment: .center) {
                        option.icon
                            .foregroundColor(.orange)
                        Text(option.title)
                    }
                }
            }
            .navigationBarTitle(Text("Settings"), displayMode: .large)
            
            //.navigationBarHidden(false)
            //.navigationBarItems()
                
        }
        .accentColor(.orange)
    }
}

struct SettingsView_Previews: PreviewProvider {
    static var previews: some View {
        SettingsView()
    }
}

Update: this issue seems to be resolved in Beta 4.

Tried with Xcode 11.3 stable. The issue is still there. Which xcode are you talking about?

This problem is still present in xcode 11.3.1. I have been using iPhone 11 Simulator.
Anyone figured out a solution?

Seeing this on Catalyst (actual app) too.

I'm also experiencing the same behavior in iOS 15, Xcode 13.0 beta, I have created project here on my-github. It can be my code that is the problem - but, of course, not :)

Same problem on iOS 15, X13b4.