Async Block in Objective-C
Run an operation on the background then update the main UI thread.
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
dispatch_async(queue, ^{
//do your work in the background here
dispatch_async(dispatch_get_main_queue(), ^{
//tell the main UI thread here
});
});
Written by Raúl Raja
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Asynchronous
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#