Created
March 14, 2017 11:44
-
-
Save embassem/5340a5ec4662f35d7d73e9abc8a92c0c to your computer and use it in GitHub Desktop.
delay swift
This file contains hidden or 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
| //***************************************************************** | |
| // MARK: - Helper Functions | |
| //***************************************************************** | |
| public func delay(_ delay:Double, closure:@escaping ()->()) { | |
| DispatchQueue.main.asyncAfter( | |
| deadline: DispatchTime.now() + Double(Int64(delay * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC), execute: closure) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment