Reputation: 36178
iOS 11 has a built in document scanner that you can launch from Notes. I’d like to scan documents for my app, is there a way to present the native document scanner and receive its images?
Upvotes: 3
Views: 635
Reputation: 1532
This is now available in iOS 13+ and is provided through the VisionKit API.
Present the VNDocumentCameraViewController
view controller, registering the VNDocumentCameraViewControllerDelegate
delegate:
let documentCameraViewController = VNDocumentCameraViewController()
documentCameraViewController.delegate = self
present(documentCameraViewController, animated: true)
Then receive the delegate calls once a document has been successfully captured by the user:
documentCameraViewController(_ controller: VNDocumentCameraViewController,
didFinishWith scan: VNDocumentCameraScan)
Upvotes: 1