The approaches that I used in earlier versions have stopped working, in fact they crash. The culprit is, I believe, TabView.
To load a new View as follows still works:
NavigationLink(destination: NextView().navigationBarBackButtonHidden(true)) {
Text("Press to see the next view")
}
And if I want to load a TabView this will, initially, also still work (MenuView generates the TabView):
NavigationLink(destination: MenuView().navigationBarBackButtonHidden(true)) {
Text("Press to Continue")
}
And the chosen View with the TabView at the bottom of the screen appears:
But from the next view how to I, programatically, go to another View? I used to be able to call:
HStack{
Button(action: {selectedTab = TabChoice.calculate}, label: { Text("Press to go to next view")
}
}
This no longer works and crashes to @main with no errors in the debug screen.
@main
struct MyApp: App {
var body: some Scene {
WindowGroup {
LaunchScreen()
}
}
}
Any ideas?
