Im using GCD blocks To call My service in the background thread.I want to provide a cancel button for the user to cancel process/Loading Svc.
How can I Stop the Execution when user Cancel’s if it's not possible Guide me to acheive same functionalty
dispatch_async( dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
// Add code here to do background processing
//
//
dispatch_async( dispatch_get_main_queue(), ^{
// Add code here to update the UI/send notifications based on the
// results of the background processing
});
});
Thank you