Reputation: 149
How do I incorporate into my AppDelegate that if a user is on a Level and exits the game (pressed home button), then the next time it's opened (multitasking) it will open the pauseLayer? I don't want the game to immediately start after they have switched back to it.
Upvotes: 0
Views: 902
Reputation: 1939
In detail:
-(void) applicationDidEnterBackground:(UIApplication*)application {
if(gameisRunning)
{
[self pauseLayer];
}
}
=)
Upvotes: 2
Reputation: 306
inside applicationDidEnterBackground, add a line of code to check whether the game is running. if the game is running, open the pauseLayer. this way when the player open it from multitasking the game will be paused.
Upvotes: 1