Before starting this blog please refer the blog to know more about GCD and thread DispatchWorkItem, DispatchGroup, DispatchBarrier, DispatchSemaphore, DispatchSources NSOperation queue How can we cancel task in GCD? Sometimes, we need extra control over the execution. To be able to cancel a task in GCD, create a work item: If task is not started, then this…