Created
October 19, 2011 16:29
-
-
Save rsaunders100/1298841 to your computer and use it in GitHub Desktop.
(iOS) Simple Background - Main Thread with blocks
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
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^ | |
{ | |
// Do heavy lifting | |
// Back to the main thread with the result | |
dispatch_sync(dispatch_get_main_queue(), ^ | |
{ | |
// Update UI etc | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment