Skip to content

Instantly share code, notes, and snippets.

@lindon-fox
Created October 20, 2014 07:43
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 lindon-fox/8b961f59546ec661f32a to your computer and use it in GitHub Desktop.
Save lindon-fox/8b961f59546ec661f32a to your computer and use it in GitHub Desktop.
Perform after delay with swift
func delay(delay:Double, closure:()->()) {
dispatch_after(
dispatch_time(
DISPATCH_TIME_NOW,
Int64(delay * Double(NSEC_PER_SEC))
),
dispatch_get_main_queue(), closure)
}
//source: http://stackoverflow.com/a/24318861/377384
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment