Skip to content

Instantly share code, notes, and snippets.

@ipedro
Last active March 23, 2016 18:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ipedro/29e4f3d65d90d2b1f302 to your computer and use it in GitHub Desktop.
Save ipedro/29e4f3d65d90d2b1f302 to your computer and use it in GitHub Desktop.
GCD background thread
// 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