import SwiftUI
struct ContentView: View {
var body: some View {
NavigationView {
NavigationLink(destination: NextContentView()){
Text("Next View")
}
}
}
}
Declare a state var and have a test:
import SwiftUI
struct ContentView: View {
@State var firstPass: Bool = true
var body: some View {
NavigationView {
if firstPass {
NavigationLink(destination: NextContentView()){ Text("Next View") }
} else {
NavigationLink(destination: CurrentView()){ Text("Other View") }
}
}
}
}
Topic:
Programming Languages
SubTopic:
Swift
Tags: