-
-
Save danmartyn/6986419 to your computer and use it in GitHub Desktop.
Typical use case for GCD
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
// Doing something on the main thread | |
dispatch_queue_t myQueue = dispatch_queue_create("My Queue",NULL); | |
dispatch_async(myQueue, ^{ | |
// Perform long running process | |
dispatch_async(dispatch_get_main_queue(), ^{ | |
// Update the UI | |
}); | |
}); | |
// Continue doing other stuff on the | |
// main thread while process is running. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment