Reputation: 145
Where can I handle code for pausing game during incoming call. I know about
-(void)applicationWillResignActive:(UIApplication *)application
but during game, how can I call it (I can't call it from SKScene, nor from view controller - only from app delegate, but how can I from there run my piece of code belonging to view controller).
Thank you.
Upvotes: 0
Views: 64
Reputation: 145
Meanwhile I figured it out, I used NSNotification, here is the line of code, put it inside view controller you want to handle it :
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pauseGame) name:UIApplicationWillResignActiveNotification object:nil];
Upvotes: 1