HiddenNavExample
SwiftUI example of programmatic only navigation. I couldn't find an example that demonstrates how to add validation before pushing a view to the NavigationStack so I built one myself.
struct ContentView: View {
@State private var showResult = false
var body: some View {
NavigationStack {
NavigationLink("Result", value: "result")
.hidden()
.navigationDestination(isPresented: $showResult) {
ResultView()
}
}
}
}