Created
October 30, 2012 09:37
-
-
Save axldyb/3979272 to your computer and use it in GitHub Desktop.
Background queue block using GCD to create a thread for us
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_queue_t mainQueue = dispatch_get_main_queue(); | |
dispatch_queue_t backgroundQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); | |
dispatch_async(backgroundQueue,^{ | |
// Do magical stuff in the background | |
dispatch_async(mainQueue,^{ | |
// Update UI in the main thread | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment