Skip to content

Instantly share code, notes, and snippets.

@alladinian
alladinian / async-gcd.m
Created July 9, 2013 08:39
How to Execute Code Asynchronously (GCD)
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
});
});