[英]Save Pressed Action for VNDocumentCameraViewController Swift
只是想知道是否有人知道如何在用戶按下 VNDocumentCameraViewController 中的保存按鈕時添加操作。 我只希望用戶只能掃描一個文檔,然后視圖應該自行關閉。
我現在有這個功能...
@objc func scanDocument() {
let scannerViewController = VNDocumentCameraViewController()
scannerViewController.delegate = self
present(scannerViewController, animated: true)
}
隨着兩個動作,都格式化為...
func documentCameraViewController(_ controller: VNDocumentCameraViewController, didFinishWith scan: VNDocumentCameraScan) {
}
但似乎沒有“DidPressSave”或類似格式的操作,只有“didFailWithError”。 我什至跳到定義上,發現他們只有這兩個。 所以想知道是否有那種方法可以添加這種操作或限制用戶只能掃描一次?
謝謝,喬丹。
來自蘋果文檔
委托將收到以下調用之一,具體取決於用戶是保存還是取消,或者會話是否失敗。
- (void)documentCameraViewController:(VNDocumentCameraViewController *)controller didFinishWithScan:(VNDocumentCameraScan *)scan;
目前無法設置要掃描的頁數限制。
您可以在VNDocumentCameraViewController類和委托VNDocumentCameraViewControllerDelegate 的文檔中看到它。
如果你願意,你可以嘗試使用WeScan
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.