1

I want to run code when the user is no longer on the app, but only if the way they exited the app is if they locked their phone. I don't want the code to run if they switch apps.

  • Did you try this one? http://stackoverflow.com/questions/31429800/how-to-check-if-the-ios-device-is-locked-unlocked-using-swift – Dawid Koncewicz Apr 02 '17 at 20:14

1 Answers1

0

I don't believe there's a way to tell if the app entered the background as the result of a lock even or another type of event. I believe Apple doesn't expose this data to developers.

Tim Johnsen
  • 1,471
  • 14
  • 33