I have some spritenodes with SKAction(); They are child's of sknode with name world
If I press the pause button in the game its animation of the spirenodes
func pause(){
if(isGamePaused)
isGamePaused = false;
world.paused = false;
} else {
isGamePaused = true;
world.paused = true;
}
}
But I cannot pause the game when is going in the background
NSNotificationCenter.defaultCenter().addObserver(self, selector: Selector("goBG:"), name: UIApplicationWillResignActiveNotification, object: nil);
func goBG(sender: AnyObject){
self.isGamePaused = true;
self.world.paused = true;
println("bg"); // called
println(world.paused);// return true
}