onDocumentDetected

Description

This event is fired when a document is detected.

Syntax

func onDocumentDetected(sender:Any, document:DcsDocument)

Parameters

sender:Any The current DcsUIVideoView object that triggers the event.
document:DcsDocument The detected document.

Return value

Void

Remarks

The event is only valid under the document mode.

Example

class ViewController: UIViewController, DcsUIVideoViewDelegate {
override func viewDidLoad() {
        super.viewDidLoad()
    }
func onDocumentDetected(_ sender: Any!, document: DcsDocument!) {
        print("Document is detected")
    }
    
    func onCaptureTapped(_ sender: Any!) {
        print("Capture is tapped")
    }
    
    func onCancelTapped(_ sender: Any!) {
        print("Cancel is tapped")
    }
    
    func onPreCapture(_ sender: Any!) -> Bool {
        print("This event is fired before capture")
        return true
    }
    
    func onPostCapture(_ sender: Any!) {
        print("This event is fired after capture")
    }
    
    func onCaptureFailure(_ sender: Any!, exception: DcsException!) {
        print("Capture failed")
    }
}
Is this page helpful?

Leave a Reply

Your email address will not be published.