Created
August 7, 2017 15:49
-
-
Save perlguy99/93e7d971d323ca732185279edac2885d to your computer and use it in GitHub Desktop.
Operate on main thread
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
// Usage: | |
// UI { | |
// Anything in here will execute on the main thread | |
// } | |
func UI(_ block: @escaping ()->Void) { | |
DispatchQueue.main.async(execute: block) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment