Skip to content

Instantly share code, notes, and snippets.

@kexoth
Created October 21, 2015 19:25
Show Gist options
  • Save kexoth/f80ba67cddfabb8711d7 to your computer and use it in GitHub Desktop.
Save kexoth/f80ba67cddfabb8711d7 to your computer and use it in GitHub Desktop.
Swift Delay Block
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