Skip to content

Instantly share code, notes, and snippets.

@axelrivera
Created December 12, 2014 14:53
Show Gist options
  • Save axelrivera/228d58139eee5958c9af to your computer and use it in GitHub Desktop.
Save axelrivera/228d58139eee5958c9af to your computer and use it in GitHub Desktop.
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), {
// do some stuff in the background
let string = "my string"
// remove if you don't need to call the main queue
dispatch_async(dispatch_get_main_queue(), {
// do some stuff in the main queue
// mostly call the UI
})
// end of remove
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment