I believe that this is due to the fact that your game rendering is not included in the main stream (of course, it should not be in the main stream), therefore, when applicationDidEnterBackground/applicationWillResignActive returned, the system immediately takes a screenshot from the video card buffer.
At this time, the stream of your game loop is still running, so it may update some frames before it is paused.
I donβt know how you implement your game loop, but you can try the following:
In applicationDidEnterBackground/applicationWillResignActive put the global semaphore ( dispatch_semaphore_t ) and block the main thread, in your game loop, watch the semaphore, and if it exists, pause the game loop and then report the semaphore.
This ensures that a screenshot is taken after pausing the game.
Also note that after applicationWillResignActive system will take a snapshot for the task switcher, and after applicationDidEnterBackground system will take a snapshot the next time the application appears in the foreground.
Hope this helps you.
CarmeloS
source share