Reputation: 840
I'm developing an app on iOS 7 with a desired feature is that
When I home button, app enter background, I will add an image to current UIWindow. So when app enter background, if user double home button on iOS 7, os will show a small screenshot of current view of my app, so user can see my added image. :) (I did it)
When user return my app by clicking app icon, I want to remove this image immediately. In this situation, "immediately" means that user can NOT see this image anymore, user just see his/her current view when app enter foreground. I try to place the code remove image on the beginning of applicationWillEnterForeground delegate, but I'm still able to see this image for a short time after it disappears.
Can anyone help me to remove it "immediately" as my desire.
Upvotes: 0
Views: 331
Reputation: 4515
Like other says it is really tricky how iOS handles these events. I've been researching and depends on the memory state of the device to do it faster or not. Indeed, in iPhone 4 and 4S may not show the image that you added on applicationWillEnterForeground
method.
If I were you I would solve it by adding a smooth fade out animation of that image when the app becomes active again. With [UIView animateWithDuration: animations:]
it could be nicely done! :)
If I find out something else I'll answer here!
Upvotes: 1
Reputation: 185
I don't think that you can do it faster, it depends of device performance. Sorry man.
Upvotes: 1
Reputation: 1232
That is done automatically for all applications, you don't need to do anything in you code.
Upvotes: 1