Skip to content

πŸ†πŸ§‘β€πŸ’» SwiftUI example of programmatic only navigation

License

Notifications You must be signed in to change notification settings

bobbyg603/HiddenNavExample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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.

Code πŸ§‘β€πŸ’»

struct ContentView: View {
  @State private var showResult = false
  var body: some View {
    NavigationStack {
      NavigationLink("Result", value: "result")
        .hidden()
        .navigationDestination(isPresented: $showResult) {
            ResultView()
        }
    }
  }
}

Preview πŸŽ₯

Hidden NavigationLink Example

About

πŸ†πŸ§‘β€πŸ’» SwiftUI example of programmatic only navigation

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages