Search code examples
iosswiftuiapplicationdelegate

When is ios auto screen capture taken?


I am trying to change the screen shot that is automatically captured by iOS when the app enters the background.

However I am not entirely sure exactly when this screenshot is taken.

For example:

If you pull down the notification bar while in the app the following method is called:

- (void) applicationWillResignActive:(UIApplication *) application {
}

Also if you double tap the home button while in the app the same method is called. In addition if an alert view is show 'applicationWillResignActive' is called.

But in both of these cases

- (void) applicationDidEnterBackground:(UIApplication *) application {
}

is not called.

So my question is, is there a screenshot captured after the call to applicationWillResignActive even if the application does not enter the background? Or does iOS only capture a screenshot after applicationDidEnterBackground?


Solution

  • you can look over here, in summary, change the view before return from applicationDidEnterBackground: