USDriverLicenseScanner is a library for scanning US driver license details from your iPhone camera.
- Make your UIViewController conformed to ScanDriverLicenseViewControllerDelegate
- Implement
func didScanResult(driverInfo: DriverLicense)
(it will be callbacked with driver license info, once scanned) - Show scanner view
/// create
let scanner = ScanDriverLicenseViewController(
title: "Scan Driver License",
focusDesc: "Align with the barcode on the back of your license.",
detailDesc: "By adding my license, I consent to a standard driver record check, powered by Checkr")
/// delegate
scanner.delegate = self
/// add cancel button
let navigation = UINavigationController(rootViewController: scanner)
scanner.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Cancel", style: .done, target: self, action: #selector(dismissSelf))
/// show
self.present(navigation, animated: true, completion: nil)
Or check out the example app.
github "tonyli508/USDriverLicenseScanner" ~> 1.0.0
Check out the example code in Carthage branch as well, if you need more details.