Skip to content

Instantly share code, notes, and snippets.

@victoraugustolls
Last active June 11, 2016 20:09
Show Gist options
  • Save victoraugustolls/c61dc57f76764af1fbb4 to your computer and use it in GitHub Desktop.
Save victoraugustolls/c61dc57f76764af1fbb4 to your computer and use it in GitHub Desktop.
Dispatch_after delay in Swift
func delay(delay:Double, closure:()->()) {
dispatch_after(
dispatch_time(
DISPATCH_TIME_NOW,
Int64(delay * Double(NSEC_PER_SEC))
),
dispatch_get_main_queue(), closure)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment