Post

Replies

Boosts

Views

Activity

iOS 18 .onChange(of: scenePhase) is constantly triggered
Hey all, I am facing a new issue on iOS 18 with ScenePhase and .onChange modifier. Here's roughly the code: .onChange(of: scenePhase, initial: true) { old, new in if new == .active { doStuff() } } on iOS 17 this was working as expected and triggered when eg. ap was brough from background or user navigated back to view on ios18 though this code gets triggered constatnly in my case when I eg. navigate to another screen on top of the one with that .onChange. after navigation happens, the onChange is being triggered continuosly and does not stop which causes doStuff() to be called multiple times
1
0
424
Sep ’24