AAMVA-Barcode-Parser 1.4.0

AAMVA-Barcode-Parser 1.4.0

Maintained by Jakub Dolejs.



  • By
  • jakubdolejs

AAMVA Barcode Parser

Parse barcodes on North American ID cards encoded using AAMVA standard.

Installation

  1. Install CocoaPods.

  2. Add a file called Podfile in your project's root folder.

  3. Refer to the Podfile reference documentation to set up your Podfile.

  4. Add the AAMVA Barcode Parser dependency in your Podfile:

    pod 'AAMVA-Barcode-Parser', '~> 1'
  5. Open Terminal, navigate to the folder with your Podfile and enter:

    pod install

Usage

import AAMVABarcodeParser

/// Parse barcode data
/// - Parameter barcodeData: Barcode data scanned from the back of a North American ID card
/// - Returns: Parsed document data
func parseBarcodeData(_ barcodeData) -> DocumentData {
    let parser = AAMVABarcodeParser()
    let documentData = try parser.parseData(barcodeData)
    if let firstName = documentData.firstName, let lastName = documentData.lastName {
        NSLog("Parsed ID card belonging to %@ %@", firstName, lastName)
    }
    return documentData
}

Reference documentation