Skip to content

Instantly share code, notes, and snippets.

@eldesperado
Created September 23, 2015 10:59
Show Gist options
  • Save eldesperado/94d918ef55953b8cb466 to your computer and use it in GitHub Desktop.
Save eldesperado/94d918ef55953b8cb466 to your computer and use it in GitHub Desktop.
Top-level utility dispatch_after function
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