Use PassportScannerViewController to capture the info page of an international passport, and return the resulting Passport object.

Initializing PassportScannerViewController

Initialize PassportScannerViewController.Builder with a completion block to receive the completion events with the result.

class YourViewController: UIViewController {

    override func viewDidAppear() {
        super.viewDidAppear()

        PassportScannerViewController.Builder(onComplete: { (isComplete, passport) in
            //Completion Block  
            if (isComplete) {
                //Handle Passport here
            } else {
                //ViewController cancelled 
            } 
        })
        .setCheckHasFace(checkHasFace: true)
        .create()
        .show(parentViewController: self)
    }

}

Because a passport always contains a photo ID, you can set setCheckHasFace to indicate whether you want the scanner to confirm that there is at least one face present on the info page of the passport. setCheckHasFace is set to true by default.

The Passport object returned

PassportScannerViewController returns a Passport object containing the image of the info page for the scanned passport.

Currently, the scanner captures only the info page of the passport and doesn’t parse any metadata from the photo. The default values for all metadata properties is an empty string.