Question

I am performing absolutely rudimentary state preservation and restoration, code in the app delegate:

-(BOOL)application:(UIApplication *)application shouldSaveApplicationState:(NSCoder     *)coder
{
    return YES;
}

-(BOOL)application:(UIApplication *)application shouldRestoreApplicationState:(NSCoder    *)coder
{
    return YES;
}

My app is as well very rudimentary, a single view that contains an SKScene. This code works beautifully, the state of the app and scene is stored when the app is interrupted, and returns to its previous state when reopened,lovely.

However, this is an action game, so I would like to give the user a second or two before the ACTIONS in the SKScene begin again after state is restored... allow them to get their fingers back on the controls, etc before things start moving... So, I am not sure how to do this, where in the restoration process callbacks (after the scene has been restored can I have my code to pause all the actions for a second or two or whatever I want, before restarting them. I assume there is a callback method I can leverage, but don't know what it is.

Was it helpful?

Solution

Have you looked into the paused property of SKNode? I pause/unpause all objects in a scene when the user summons/dismiss a popover menu and this property works beautifully for me.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top