I have a pause system with a function and a button and it works perfect, i know when the app enters background it automatically pauses and when it comes back it automatically unpauses itself, my problem is that I don't know how to keep it paused when it becomes active again.
func applicationWillResignActive(application: UIApplication) {
NSNotificationCenter.defaultCenter().postNotificationName("Pause", object: nil) // tried here
}
func applicationDidBecomeActive(application: UIApplication) {
NSNotificationCenter.defaultCenter().postNotificationName("Pause", object: nil) // tried here
}
I tried on both those methods separately but the game keeps running, sometimes it shows my Pause menu (a layer above the gameplay) and still run in the background. So what is the correct way to achieve this ?