Skip to content

Instantly share code, notes, and snippets.

@bouchtaoui-dev
Last active December 2, 2017 19:50
Show Gist options
  • Select an option

  • Save bouchtaoui-dev/55d8b003502b79d66329aa80758f0a42 to your computer and use it in GitHub Desktop.

Select an option

Save bouchtaoui-dev/55d8b003502b79d66329aa80758f0a42 to your computer and use it in GitHub Desktop.
// This one I use very often
dispatch_async(dispatch_get_main_queue(), ^{
// run following code in main queue
// this block will be put in the queue to be executed later
});
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
// do some task in background
dispatch_async(dispatch_get_main_queue(), ^{
// update some UI
});
});
// Need some more examples
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment