So I want to present a new view using SwiftUI, without the user having to tap a button, since NavigationButton would work with that. Here is an example
struct ContentView : View {
var model: Model
var body: some View {
NavigationView {
Text("Hello World")
}.onAppear {
if model.shouldPresent {
// present a new view
}
}
}
}
In the onAppear I want to include some code that will push a new view onto the navigation stack.