Skip to content

Instantly share code, notes, and snippets.

@cheebow
Last active October 23, 2015 07:46
Show Gist options
  • Save cheebow/0cdb61e8b1fdc18c08bc to your computer and use it in GitHub Desktop.
Save cheebow/0cdb61e8b1fdc18c08bc to your computer and use it in GitHub Desktop.
performAfterDelay
import Foundation
class Utils {
class func performAfterDelay(block: dispatch_block_t, delayTime: Double) {
let delay = delayTime * Double(NSEC_PER_SEC)
let time = dispatch_time(DISPATCH_TIME_NOW, Int64(delay))
dispatch_after(time, dispatch_get_main_queue(), block)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment