chews
chews

Reputation: 2659

Screen Off event or property on iPhone

Is there a way to determine if the screen has been shut off via the top Power button?

I just need to know if the screen has been somehow set to off to kill a loop that updates location.

Thanks

Upvotes: 10

Views: 924

Answers (1)

Ben Gottlieb
Ben Gottlieb

Reputation: 85542

Your Application delegate will receive a applicationWillResignActive: message just before the screen is locked (or when the phone rings or another window pops up). This is an excellent time to kill any idle-time processes. After re-activating, you'll receive an applicationDidBecomeActive: message, in which you can restart all this stuff.

Upvotes: 18

Related Questions