I used GCD to perform the background execution. however in my ViewController class there is button . How i can stop the GCD in between the execution once user click on button ? here is my code
dispatch_async(dispatch_get_global_queue(Int(QOS_CLASS_BACKGROUND.value), 0), {
self.StartProcess()
})
@IBAction func buttonIsClicked(sender: AnyObject) {
// how to stop GCD execution?
}