1

Yesterday, Xcode 11.3 was released, bringing along some new problems. If you navigate to the DetailView and use the default back button to return, you are unable to push the DetailView again. However, with the custom button, it works fine. Do you have any suggestions?

class Model: ObservableObject {
    @Published var isPushed = false
}

struct ContentView: View {
    @EnvironmentObject var model: Model
    
    var body: some View {
        NavigationView {
            VStack {
                Button("push") {
                    self.model.isPushed = true
                }
                
                NavigationLink(destination: DetailView(), isActive: $model.isPushed) { EmptyView() }
            }
        }
    }
}

struct DetailView: View {
    @EnvironmentObject var model: Model

    var body: some View {
        Button("get me back") {
            self.model.isPushed = false
        }
    }
}

Same problem

struct ContentView: View {
    
    var body: some View {
        NavigationView {
            VStack {
                NavigationLink(destination: Text("Pushed")) { Text("push") }
            }
        }
    }
}
ozmpai
  • 2,454
  • 2
  • 14
  • 19

1 Answers1

2

You're not the first, this question was asked before. Try to downgrade xCode. I think Apple should fix this bug in new update, I'll wrote in apple feedback assistant soon too.

update: feedback sent to Apple

Hrabovskyi Oleksandr
  • 3,070
  • 2
  • 17
  • 36