TDType
public enum TDType : String, CaseIterable
An enumeration representing the type of a travel document (TD) based on the Machine Readable Zone (MRZ) structure.
According to the ICAO Document 9303 and ISO/IEC 7810 standard, there are three standardized document types depending on the position and the size of the MRZ within the physical document.
Note
MRZ is duplicated within the DataGroup1
from the physical smart card.
See also
MRZ
and TravelDocument
-
Type 1 travel document (TD1).
Declaration
Swift
case TD1
-
Type 2 travel document (TD2).
Declaration
Swift
case TD2
-
Type 3 travel document (TD3).
Declaration
Swift
case TD3
-
A textual description of the travel document type.
Declaration
Swift
public var description: String { get }
-
The length of the MRZ code for the specific travel document type.
Note
TD1 documents are 90 characters long, TD2 ones are 72 characters long and TD3 ones are 88 characters longDeclaration
Swift
public var length: Int { get }
-
Determine the
TDType
based on the given MRZ code length.Declaration
Swift
public static func of(length: Int) -> TDType?
Parameters
length
The length of the MRZ code.
Return Value
The corresponding
TDType
, if one is found; otherwise,nil
.