I have below logic which give app state: But i wanted to add logic when app move to foreground.
In Swift we have method. I am looking for something similar method in swiftui
func sceneWillEnterForeground(_ scene: UIScene) {
but in Swiftui i only have .active, .inactive and .background
.onChange(of: scenePhase) { newPhase in
if newPhase == .active {
} else if newPhase == .inactive {
} else if newPhase == .background {
}
}