And*_*rra 6 computer-vision ios swift-protocols swift4
我正在为 iOS 应用程序运行 Vision Framework 请求,如下所示:
let textDetectionRequest = VNDetectTextRectanglesRequest(completionHandler: self.findTextBoxes)
let textDetectionHandler = VNImageRequestHandler(cgImage: image, orientation: orientation, options: [:])
DispatchQueue.global(qos: .background).async {
   do {
        try textDetectionHandler.perform([textDetectionRequest])
   } catch {
        print(error)
   }
}
它工作正常,我正在使用通知/观察者模式在请求完成后采取进一步的操作。有时,在应用程序中,我需要在请求完成其操作之前取消进程,那么我可以使用 Vision Framework 中的任何类型的协议/委托方法来调用取消吗?
谢谢。