-2

I want to be able to do different things depending on why an application entered background.? Ex: Home button pressed , Location services permissions .

Is there a way to find out?

1 Answers1

0

You can listen to the applications state via the app delegate methods. This will determine what state your application is in.

https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIApplicationDelegate_Protocol/index.html

You can also register for Notifications which relate to those states. See this post for some further examples.

What's the best way to detect when the app is entering the background for my view?

I believe you will see different notification states for those two events.

Community
  • 1
  • 1
James Parker
  • 2,095
  • 3
  • 27
  • 48