Created
July 9, 2013 08:39
-
-
Save alladinian/5955702 to your computer and use it in GitHub Desktop.
How to Execute Code Asynchronously (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
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0ul); | |
dispatch_async(queue, ^{ | |
// Perform async operation | |
dispatch_sync(dispatch_get_main_queue(), ^{ | |
// Update UI | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment