Skip to content

Instantly share code, notes, and snippets.

@jackywang135
Last active November 25, 2015 21:41
Show Gist options
  • Save jackywang135/d7211e0b82651126d860 to your computer and use it in GitHub Desktop.
Save jackywang135/d7211e0b82651126d860 to your computer and use it in GitHub Desktop.
Convenience method for calling GCD dispatch_after
public func delay(delay: NSTimeInterval, 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