I\'m developing a game with SpriteKit that can be paused during execution and can be resumed.
But I have a problem with applicationDidEnterBackground
when the h
Pretty much the same as here
AppDelegate:
func applicationWillResignActive(application: UIApplication) {
NSNotificationCenter.defaultCenter().postNotificationName("PauseGameScene", object: self)
}
GameSceneViewController:
override func viewDidLoad() {
super.viewDidLoad()
NSNotificationCenter.defaultCenter().addObserver(self, selector: Selector("pauseGameScene"), name: "PauseGameScene", object: nil)
}
func pauseGameScene() {
if self.skView.scene != nil {
self.skView.paused = self.skView.scene.paused = true
}
}