I have a problem I have in my code. 2 navigation links that go to different views.
Does someone know how I can make the first navigation link not appear to me?
This is my code:
struct ContentView: View {
@State var navigationFlag = false
var body: some View {
NavigationView {
VStack {
Text("First View")
Button(action: {
self.navigationFlag = true
}, label: {
Text("navigate")
})
NavigationLink(destination: SwiftUIView(),
isActive: self.$navigationFlag,
label: {
EmptyView()
})
}
}
}
}
struct SwiftUIView: View {
var body: some View {
NavigationView{
NavigationLink(destination:Swift2UIView()) {
Text("hola")
}
}
}