Skip to content

Instantly share code, notes, and snippets.

@daoseng33
Last active June 24, 2020 11:13
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daoseng33/e258c74001869067d6ad7235124f4b37 to your computer and use it in GitHub Desktop.
Save daoseng33/e258c74001869067d6ad7235124f4b37 to your computer and use it in GitHub Desktop.
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
if isMovingToParent {
// start timer
}
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
if isMovingFromParent {
// invalidate timer
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment