1

In the following code, I've depicted the issue I'm facing.

  • AddContentView - is having just a single label
  • ContentView has a navigation link with a text and a navigation link.

The Navigation-link works fine for the first time but stops working afterwords.

import SwiftUI

struct AddContentView: View {
    var body: some View {
        Text("Hello, World!")
    }
}

struct ContentView: View {
    var body: some View {
        NavigationView {
            VStack {
                Text("Hello, World!")
                NavigationLink(destination: AddContentView()) {
                    Text("Navigate")
                }
            }.navigationBarTitle("First")
        }
    }
}

Please refer to the demo attached here.

enter image description here

  • Possible duplicate of this https://stackoverflow.com/questions/59483962/swiftui-unable-to-navigate-back-and-forth-with-navigationlink/59484980#59484980 – kchopda Feb 06 '20 at 18:37
  • Okay but can't delete the question now - You cannot delete this question as others have invested time and effort into answering it. For more information, visit the help center. – Sagar Kothari Turvo Feb 06 '20 at 23:20
  • I didn't mean to tell you for delete question. I just want to tell you you can use that solution until we get any solution. – kchopda Feb 07 '20 at 13:18

1 Answers1

2

This is a simulator bug only, if you have a device to test on the NavigationLink works correctly multiple times. Hopefully Apple will fix this soon.

Andy Heard
  • 1,715
  • 1
  • 15
  • 25