2

Is there a way to check when a user has shutdown/closed my app?

I want to save some data when this happens and I'm not sure if there's a way to do it.

thefan12345
  • 137
  • 15

2 Answers2

5

Yes, you can do this in - (void)applicationWillTerminate:(UIApplication *)application method of the AppDelegate.

Save data, user settings in this method.

David 'mArm' Ansermot
  • 5,839
  • 6
  • 44
  • 80
2

When a user closes the app, - (void)applicationWillTerminate:(UIApplication *)application gets called, which is located in the AppDelegate. You can do the needful in that.

Kunal Shah
  • 104
  • 5