Reputation: 136
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.
Upvotes: 2
Views: 72
Reputation: 104
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.
Upvotes: 2
Reputation: 6112
Yes, you can do this in - (void)applicationWillTerminate:(UIApplication *)application
method of the AppDelegate.
Save data, user settings in this method.
Upvotes: 5