Skip to content

Instantly share code, notes, and snippets.

@daoseng33
Created January 8, 2019 07:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daoseng33/0df4eef72e3027608e9101a8cf7304e9 to your computer and use it in GitHub Desktop.
Save daoseng33/0df4eef72e3027608e9101a8cf7304e9 to your computer and use it in GitHub Desktop.
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
if isBeingPresented {
// start timer
}
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
if isBeingDismissed {
// invalidate timer
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment