Search code examples
ioslaunching-application

iOS 7+'s "Goodbye Snapshot"


This is an unusual one, but it's something I find a bit "quirky."

Since iOS 7, when an app is backgrounded (Home button pressed, and it resigns active), the OS takes a sceengrab of the app.

When the app is brought back to the fore, that screengrab is shown as the app re-launches. It's only a half second or so.

However, for the app I'm working on, that screenshot is misleading. The device has been disconnected, so the data displayed is completely wrong.

1) I'd like to be able to replace the screengrab with the LaunchImage (which I specify) as it is shown; even if the app is being "reawakened."

Is this something that I can do?

2) Maybe there's a way for me to replace the stored screengrab?

3) If I can get sufficient notice (There does not seem to be a message before the screengrab is taken), then I can replace the screen with the LaunchImage.


Solution

  • It is possible to know when an app is going to resign active or be backgrounded. The UIApplicationDelegate protocol defines the method - (void)applicationWillResignActive:(UIApplication *)application which is called before an application is moved from active to inactive.

    Knowing the timing of that method's invocation, you can do whatever you want before the app goes inactive. So, you could toss a view on top of the screen that contains whatever you want. This would then become the multitasking image, and the launch image.

    Reference the following blog post for a more in depth analysis: http://blog.adambell.ca/post/73339778302/dynamic-ios-multitasking