1

i don't know if this problem is swift ui problem or does it simulator problem. I didn't get a chance to try it on the real device.

When I first click on the post but it does not go back when I click.

import SwiftUI

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

struct SecondView: View {
    @State var clicked = false
    var body: some View {
        NavigationView {
            NavigationLink(destination: ContentView(), isActive: $clicked) {
                Text("Click")
            }
        }
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        SecondView()
    }
}

For example: https://gifyu.com/image/mV1D

  • Does this answer your question? [NavigationLink Works Only for Once](https://stackoverflow.com/questions/59279176/navigationlink-works-only-for-once) – Sezgin Paksoy Jan 11 '20 at 08:07

0 Answers0