Last active
March 23, 2016 18:37
-
-
Save ipedro/29e4f3d65d90d2b1f302 to your computer and use it in GitHub Desktop.
GCD background thread
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
// get off main thread and execute costly code | |
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{ | |
// jump back to main thread and update your UI | |
dispatch_async(dispatch_get_main_queue(), ^{ | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment