Created
May 17, 2017 00:45
-
-
Save efremidze/0479e59284f2135a48f45943dc607bf2 to your computer and use it in GitHub Desktop.
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
func delay(_ seconds: Int, _ queue: DispatchQueue = .main, _ closure: @escaping () -> Void) { | |
let time = DispatchTime.now() + .seconds(seconds) | |
queue.asyncAfter(deadline: time, execute: closure) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment