Search code examples
iosiphonexcodecounterhome-button

Count User Actions


I am a beginning programmer but I was wondering how I could keep track of a user's actions. For example, hypothetically, the goal of my application is to keep track of how many times the user presses the home button (or opens the internet, etc). Would it be possible to increment a counter each time the user pressed the home button (even though that would exit my app, and other apps)?


Solution

  • iOS is sandboxed, meaning that you can only keep tack of user actions that are targeted to your running app. Your app can not monitor the home button or the running of other apps such as Safari.