Reputation: 103
I just want to show an alert when user just quit the application before application entering the background, how can I do that??
If I show the alert in applicationDidEnterBackground:(UIApplication *)application
method then this alert will be shown when we again resume the application, but I need to show the alert before the application enters the background.
Upvotes: 0
Views: 281
Reputation: 20187
applicationWillResignActive and applicationWillTerminate may be of interest to this general question—but you can't present anything into the UI once the home button is pressed. These methods do let you briefly run any critical code however, while the home screen is being presented to the user.
Upvotes: 0
Reputation: 119242
You can't do this, and rightly so. When the user presses the home button, they go to the home screen. This is a fundamental part of the iOS user experience. Nothing stops the home button working.
Upvotes: 4