UIApplication
has the handy applicationState
property that allows you to see if your application is in the background or not. In action (and share) extensions, use of UIApplication
is illegal, and even if you do get an instance of it within an extension it always reports applicationState=UIApplicationStateBackground
. I also tried observing UIApplicationDidEnterBackgroundNotification
, it never fires.
Is there a way to effectively tell if an extension is running within an app that's in the foreground or background?