SouthAfricaDriversLicenseModel

A class derived from DriversLicenseModel containing details specific to the South Africa drivers license document

Declaration

@objc final public class SouthAfricaDriversLicenseModel : DriversLicenseModel {
    @objc final public var identityNumber: String? { get }
    @objc final public var identityNumberDateOfBirth: Date? { get }
    @objc final public var identityNumberSex: Sex { get }
    @objc final public var identityNumberCitizenship: CitizenshipType { get }
    @objc final public var identityNumberADigit: Int { get }
    @objc final public var identityNumberCheckDigit: Int { get }
    @objc final public var initials: String? { get }
    @objc final public var surname: String? { get }
    @objc final public var sex: Sex { get }
    @objc final public var dateOfBirth: Date? { get }
    @objc final public var vehicleCodes: [String]? { get }
    @objc final public var prdpCode: String? { get }
    @objc final public var idCountryOfIssue: String? { get }
    @objc final public var licenseCountryOfIssue: String? { get }
    @objc final public var vehicleRestrictions: [String]? { get }
    @objc final public var idNumberType: String? { get }
    @objc final public var driverRestrictions: String? { get }
    @objc final public var prdpExpiry: Date? { get }
    @objc final public var licenseIssueNumber: String? { get }
    @objc final public var validFrom: Date? { get }
    @objc final public var validTo: Date? { get }
    @objc final public var issueDates: [Date]? { get }
    @objc final public var barcodeImage: UIImage? { get }
    @objc final public var croppedDocumentBackImage: UIImage? { get }
    @objc final public var barcodeImagePath: String? { get }
    @objc final public var croppedDocumentBackImagePath: String? { get }
    
    @objc override final public func saveImages()
    override final public func encode(to encoder: Encoder) throws
}

Only relevant details are shown, boilerplate or standard Swift generated code is omitted

Summary

Public variables

Name

Type

Description

Data source

String?

The identity number of the subject as found on the drivers license document.

Barcode

Date?

The date of birth for the South African identity number.

Barcode

The sex for the South African identity number.

Barcode

The citizenship type for the South African identity number.

Barcode

Int

The A digit for the South African identity number.

Barcode

Int

The check digit for the South African identity number.

Barcode

String?

The initials of the subject as found on the drivers license document.

Barcode

String?

The surname of the subject as found on the drivers license document.

Barcode

The sex of the subject as found on the drivers license document.

Barcode

Date?

The date of birth of the subject as found on the drivers license document.

Barcode

[String]?

The vehicle codes of the drivers license document.

Barcode

String?

The PRDP code of the drivers license document.

Barcode

String?

The ID country of issue of the subject as found on the drivers license document.

Barcode

String?

The license country of issue of the drivers license document.

Barcode

[String]?

The vehicle restrictions of the subject as found on the drivers license document.

Barcode

String?

The ID number type of the subject as found on the drivers license document.

Barcode

String?

The driver restrictions of the subject as found on the drivers license document.

Barcode

Date?

The PRDP expiry of the drivers license document.

Barcode

String?

The license issue number of the drivers license document.

Barcode

Date?

When the drivers license document is valid from.

Barcode

Date?

When the drivers license document is valid until.

Barcode

[Date]?

The issue dates of the drivers license document.

Barcode

UIImage?

The cropped version of documentBackImage, containing just the barcode.

Back of document

UIImage?

The cropped version of documentBackImage, containing just the document.

Back of document

String?

The path to barcodeImage, after it is saved. Otherwise nil.

Local storage

String?

The path to croppedDocumentBackImage, after it is saved. Otherwise nil.

Local storage

Public methods

Signature

Return Type

Description

Void

Saves the barcodeImage and croppedDocumentBackImage and populates their respective path variables.

Void

Encodes the model using the encoder provided. Used to convert the model to JSON.

Validation

The following validation and verification applies to this document:

Check digit validation

Value

Validation type

Identity number

Check digit using Luhn algorithm.

Component verification

As explained in Validation & Verification the following fields are verified across the front and back components of the document.

Value

Source

Identity number

Front: OCR

Back: Barcode

Public variables

identityNumber

@objc final public var identityNumber: String? { get }

Example: "8801235111088"

The identity number of the subject as found on the drivers license document.

identityNumberDateOfBirth

@objc final public var identityNumberDateOfBirth: Date? { get }

Example: 1988/01/23

The date of birth for the South African identity number.

identityNumberSex

@objc final public var identityNumberSex: Sex { get }

Example: Sex.Male

The sex for the South African identity number.

identityNumberCitizenship

@objc final public var identityNumberCitizenship: CitizenshipType { get }

Example: CitizenshipType.Citizen

The citizenship type for the South African identity number.

identityNumberADigit

@objc final public var identityNumberADigit: Int { get }

Example: 8

The A digit for the South African identity number.

identityNumberCheckDigit

@objc final public var identityNumberCheckDigit: Int { get }

Example: 8

The check digit for the South African identity number.

initials

@objc final public var initials: String? { get }

Example: "J"

The initials of the subject as found on the drivers license document.

surname

@objc final public var surname: String? { get }

Example: "DOE"

The surname of the subject as found on the drivers license document.

sex

@objc final public var sex: Sex { get }

Example: Sex.Male

The sex of the subject as found on the drivers license document.

dateOfBirth

@objc final public var dateOfBirth: Date? { get }

Example: 1990/01/01

The date of birth of the subject as found on the drivers license document.

vehicleCodes

@objc final public var vehicleCodes: [String]? { get }

Example: ["B"]

The vehicle codes of the drivers license document.

prdpCode

@objc final public var prdpCode: String? { get }

Value can be nil

The PRDP code of the drivers license document.

idCountryOfIssue

@objc final public var idCountryOfIssue: String? { get }

Example: "ZA"

The ID country of issue of the subject as found on the drivers license document.

licenseCountryOfIssue

@objc final public var licenseCountryOfIssue: String? { get }

Example: "ZA"

The license country of issue of the drivers license document.

vehicleRestrictions

@objc final public var vehicleRestrictions: [String]? { get }

Example: ["0"]

The vehicle restrictions of the subject as found on the drivers license document.

idNumberType

@objc final public var idNumberType: String? { get }

Example: "02"

The ID number type of the subject as found on the drivers license document.

driverRestrictions

@objc final public var driverRestrictions: String? { get }

Example: "00"

The driver restrictions of the subject as found on the drivers license document.

prdpExpiry

@objc final public var prdpExpiry: Date? { get }

Value can be nil

Example: 2025/01/01

The PRDP expiry of the drivers license document.

licenseIssueNumber

@objc final public var licenseIssueNumber: String? { get }

Example: "01"

The license issue number of the drivers license document.

validFrom

@objc final public var validFrom: Date? { get }

Example: 2020/01/01

When the drivers license document is valid from.

validTo

@objc final public var validTo: Date? { get }

Example: 2025/01/01

When the drivers license document is valid to.

issueDates

@objc final public var issueDates: [Date]? { get }

Example: [2020/01/01]

The issue dates of the drivers license document.

barcodeImage

@objc final public var barcodeImage: UIImage? { get }

The cropped version of documentBackImage, containing just the barcode.

croppedDocumentBackImage

@objc final public var croppedDocumentBackImage: UIImage? { get }

The cropped version of documentBackImage, containing just the document.

barcodeImagePath

@objc final public var barcodeImagePath: String? { get }

The path to barcodeImage, after it is saved. Otherwise nil.

croppedDocumentBackImagePath

@objc final public var croppedDocumentBackImagePath: String? { get }

The path to croppedDocumentBackImage, after it is saved. Otherwise nil.

Public methods

saveImages()

@objc override final public func saveImages()

This function also calls its super function

Saves the barcodeImage and croppedDocumentBackImage and populates their respective path variables.

encode(to encoder: Encoder)

override final public func encode(to encoder: Encoder) throws

This function also calls its super function

Encodes the model using the encoder provided. Used to convert the model to JSON.

See also

Last updated