How can i navigate from view to another using a button instead of using NavigationView or a sheet.
kind regards
How can i navigate from view to another using a button instead of using NavigationView or a sheet.
kind regards
try this:
you cannot navigate without navigationview, but you can hide navigationbar if you want to.
struct ContentView: View {
@State var navigate = false
var body: some View {
NavigationView {
VStack {
NavigationLink(destination: Text("aha"), isActive: self.$navigate) {
EmptyView().hidden()
}.frame(height:0)
Button(action: {
self.navigate = true
}) {
Text("go")
}
}
}
}
}