I am trying to create a multi-platform app from SwiftUI.
Here is my code in in
@main
struct MyApp: App
@State var sceneManager = SceneManager.shared
var body: some Scene {
WindowGroup {
if sceneManager.state == .landing {
LandingPageView()
} else if sceneManager.state == .historyRecord {
HistoryRecordView()
}
}
}
when my login did success, I will change SceneManager.shared property, from .landing to .historyRecord
but the view didn't change, how should I change root view of scene? Thanks