The DriverLicense subclass defines the user ID information for the U.S and most international driver licenses.

The property values are in Raw format as read from the barcode.

DriverLicense class

The ‘DriverLicense’ object looks like this:

open class DriverLicense {

    public var cardId: String! //Unique ID to identify the card
    public var id_face_coordinate_x, id_face_coordinate_y, id_face_width, id_face_height: Int!
    internal var firstName, middleName, lastName, gender, addressStreet, addressCity, 
                 addressState, addressZip, country, issueDate, expirationDate, birthDate, 
                 idNumber, weight, height, hairColor, eyeColor: String!
    public var frontImage, backImage: UIImage!

    // You can use getters/setters for the properties to get/set the values. 
    // Values for id_face_coordinate_x, id_face_coordinate_y, id_face_width, id_face_height
    // can only be set internally by the library by calling `setFrontImage`

    // This methods set the property frontImage and throws an error if it cannot find a face  
    // on the image. It also sets the properties id_face_coordinate_x, id_face_coordinate_y,
    // id_face_width, id_face_height
    public func setFrontImage(_ value: UIImage) throws 
    public func getFrontImage() -> UIImage

    // Translates and returns the properties id_face_coordinate_x, id_face_coordinate_y,
    // id_face_width, id_face_height to a CGRect
    public func getFaceCoordinates() -> CGRect

    public func setBackImage(_ value: UIImage)
    public func getBackImage() -> UIImage

    public func setFirstName(_ value: String)
    public func getFirstName() -> String
    public func setMiddleName(_ value: String)
    public func getMiddleName() -> String
    public func setLastName(_ value: String)
    public func getLastName() -> String
    public func setGender(_ value: String)
    public func getGender() -> String
    public func setAddressStreet(_ value: String)
    public func getAddressStreet() -> String
    public func setAddressCity(_ value: String)
    public func getAddressCity() -> String
    public func setAddressState(_ value: String)
    public func getAddressState() -> String
    public func setAddressZip(_ value: String)
    public func getAddressZip() -> String
    public func setCountry(_ value: String)
    public func getCountry() -> String
    public func setIssueDate(_ value: String)
    public func getIssueDate() -> String
    public func setExpirationDate(_ value: String)
    public func getExpirationDate() -> String
    public func setBirthDate(_ value: String)
    public func getBirthDate() -> String
    public func setIdNumber(_ value: String)
    public func getIdNumber() -> String
    public func setWeight(_ value: String)
    public func getWeight() -> String
    public func setHeight(_ value: String)
    public func getHeight() -> String
    public func setHairColor(_ value: String)
    public func getHairColor() -> String
    public func setEyeColor(_ value: String)
    public func getEyeColor() -> String

}

Data model

Property Type Description
id_face_coordinate_x Int The x-axis coordinate of the user’s driver license photo.
id_face_coordinate_y Int The y-axis coordinate of the user’s driver license photo.
id_face_width Int The width of the user’s driver license photo.
id_face_height Int The height of the user’s driver license photo.
firstName String The user’s first name as shown on the driver license.
middleName String The user’s middle name as shown on the driver license.
lastName String The user’s last name as shown on the driver license.
gender String The user’s gender as shown on the driver license.
addressStreet String The user’s street address as shown on the driver license.
addressCity String The user’s city of residence as shown on the driver license.
addressState String The user’s state or province of residence as shown on the driver license.
addressZip String The user’s postal code as shown on the driver license.
country String The user’s country of residence as shown on the driver license.
issueDate String The issue date of the user’s driver license as shown on the driver license.
expirationDate String The expiration date of the user’s driver license as shown on the driver license.
birthDate String The user’s date of birth as shown on the driver license.
idNumber String The user’s driver license ID number as shown on the driver license.
weight String The user’s weight as shown on the driver license.
height String The user’s height as shown on the driver license.
hairColor String The user’s hair color as shown on the driver license.
eyeColor String The user’s eye color as shown on the driver license.
frontImage UIImage The complete front image of the user’s driver license.
backImage UIImage The complete back image of the user’s driver license.