Last active
October 23, 2015 07:46
-
-
Save cheebow/0cdb61e8b1fdc18c08bc to your computer and use it in GitHub Desktop.
performAfterDelay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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