Last active
March 19, 2019 15:54
-
-
Save Ikloo/ac3ed77ddaf6e06e6b42ff9970cd4e6e to your computer and use it in GitHub Desktop.
DispatchQueue extension
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
extension DispatchQueue { | |
static var userInteractive: DispatchQueue { return DispatchQueue.global(qos: .userInteractive) } | |
static var userInitiated: DispatchQueue { return DispatchQueue.global(qos: .userInitiated) } | |
static var utility: DispatchQueue { return DispatchQueue.global(qos: .utility) } | |
static var background: DispatchQueue { return DispatchQueue.global(qos: .background) } | |
func after(_ delay: TimeInterval, execute closure: @escaping () -> Void) { | |
asyncAfter(deadline: .now() + delay, execute: closure) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment