thefan12345
thefan12345

Reputation: 136

Check for app shutdown/close

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

Answers (2)

Kunal Shah
Kunal Shah

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

David Ansermot
David Ansermot

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

Related Questions