// // NCDocumentCamera.swift // Nextcloud // // Created by Marino Faggiana on 03/01/23. // Copyright © 2023 Marino Faggiana. All rights reserved. // import Foundation import VisionKit class NCDocumentCamera: NSObject, VNDocumentCameraViewControllerDelegate { static let shared: NCDocumentCamera = { let instance = NCDocumentCamera() return instance }() var viewController: UIViewController? func openScannerDocument(viewController: UIViewController) { self.viewController = viewController guard VNDocumentCameraViewController.isSupported else { return } let controller = VNDocumentCameraViewController() controller.delegate = self self.viewController?.present(controller, animated: true) } func documentCameraViewController(_ controller: VNDocumentCameraViewController, didFinishWith scan: VNDocumentCameraScan) { for pageNumber in 0..