Skip to content

Instantly share code, notes, and snippets.

@mathewsanders
Last active August 29, 2015 14:06
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 mathewsanders/3f557b632f9be8180d2c to your computer and use it in GitHub Desktop.
Save mathewsanders/3f557b632f9be8180d2c to your computer and use it in GitHub Desktop.
animateWithDuration and delay
let openAnimationDuration = 0.5
let numberOfSecondsToPresent = 1
let closeAnimationDuration = 0.5
UIView.animateWithDuration(openAnimationDuration, animations: {
// do changes to animate showing the popover here...
}, completion: { finished in
UIView.animateWithDuration(closeAnimationDuration, delay: numberOfSecondsToPresent, options: nil, animations: {
// do changes to animate hiding the popover here...
}, completion: nil)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment