我使用视觉套件进行文档扫描。我可以扫描并保存文档,但是在关闭后返回此屏幕后,旧的扫描图像会显示在屏幕的左下角。解雇后如何清除扫描阵列?
代码:
let vc = VNDocumentCameraViewController()
override func viewDidLoad() {
super.viewDidLoad()
vc.delegate = self
}
//Save button action in document VC
func documentCameraViewController(_ controller: VNDocumentCameraViewController, didFinishWith scan: VNDocumentCameraScan) {
print("Found \(scan.pageCount)")
var imgArray: Array<UIImage> = []
for i in 0 ..< scan.pageCount {
let image = scan.imageOfPage(at: i)
imgArray.append(image)
}
dismiss(animated: true) {
self.getFileName(img: imgArray)
}
}