SwiftUI: How to detect if the application in background or foreground?

How to use scenePhase to detect scene state? — iOS 14 — XCode 12

Prafulla Singh

--

Different ways to get scene phase and App phase

Most of the apps have use case to detect app state like background, foreground etc. With iOS 14, The app delegate and scene delegates are not part of code template. To manage scene state apple introduced a new environment variable called…

--

--