Last active
August 29, 2015 13:56
-
-
Save r3econ/9345283 to your computer and use it in GitHub Desktop.
Perform a block in a background thread, and call a completion block on the main thread when its done.
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
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^ | |
{ | |
// Background thread stuff. | |
dispatch_async(dispatch_get_main_queue(), ^ | |
{ | |
// Main thread stuff. | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment