Alexander
Alexander

Reputation: 233

How can I pause the game when my app goes into the background?

I got a Tetris game and when the game is being played and after the application goes into the background, it continues working so that the player loses the game after a period of time. I want to make my game paused when the application is phased down.

How can I respond to changes in the state of the application (background or foreground)?

Upvotes: 0

Views: 238

Answers (1)

paulmelnikow
paulmelnikow

Reputation: 17218

Have your app delegate implement -applicationWillResignActive: and pause the game.

Upvotes: 1

Related Questions