Stop a queue
Above ViewDidLoad:
private var workItem: DispatchWorkItem?
In ViewDidLoad or where the queue shows:
workItem = DispatchWorkItem {
//actions in the queue
}
DispatchQueue.main.asyncAfter(deadline: .now(), execute: workItem!)
In ViewDidDisappear
//if loading web view
self.nameOfWebView.stopLoading()
workItem?.cancel()
Comments
Post a Comment