Skip to content

Instantly share code, notes, and snippets.

@ikhanhmai
Created December 10, 2015 01:52
Show Gist options
  • Save ikhanhmai/8d0f48090a49d7a2b1a6 to your computer and use it in GitHub Desktop.
Save ikhanhmai/8d0f48090a49d7a2b1a6 to your computer and use it in GitHub Desktop.
iOS - returnFromBackground
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
NSNotificationCenter.defaultCenter().addObserver(self, selector: "returnFromBackground", name: UIApplicationDidBecomeActiveNotification, object: nil)
}
override func viewWillDisappear(animated: Bool) {
super.viewWillDisappear(animated)
NSNotificationCenter.defaultCenter().removeObserver(self,name: UIApplicationDidBecomeActiveNotification, object: nil)
}
func returnFromBackground(){
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment