Skip to main content

ZaigIosOcrConfiguration


let visualConfiguration = VisualConfiguration()
visualConfiguration.setOnboarding(onboardingFilePath: Bundle.main.path(forResource: "onboarding", ofType: "png")!, onboardingWidth: 200)

let textConfiguration = TextConfiguration()
textConfiguration.setCustomText(on: .onboardingTitle, text: "Let's get started!")
textConfiguration.setCustomText(on: .onboardingFirstLabel, text: "- Go to a location with good lighting")
textConfiguration.setCustomText(on: .onboardingSecondLabel, text: "- Remove the document from the plastic")

let ocrConfig = ZaigIosOcrConfiguration(environment: ZaigIosOcrEnvironment.Sandbox,
mobileToken: "41fb4755-9bcf-4ae3-b981-b6009e51ce4a",
sessionId: "288eb399-4936-4133-ab2c-5611d6e5bb7a",
documentSteps: documentSteps,
backgroundColor: "#C9CCD3",
fontColor: "#337DFF",
fontFamily: .open_sans,
showIntroductionScreens: true,
showSuccessScreen: false,
logLevel: .debug
)

ocrConfig.setVisualConfiguration(visualConfiguration: visualConfiguration)
ocrConfig.setTextConfiguration(textConfiguration: textConfiguration)

The ZaigIosOcrConfiguration class is used so you can configure environment, credentials, visual and textual aspects, and the document image collection flow, that is, all the necessary settings for SDK customization and operation.

In the table below you will find the detail of all arguments that must be used in its instantiation:

nametypedescription
environmentZaigIosOcrEnvironment(required) Enumerator that describes the environment.
mobileTokenstring(required) Token sent by QI Tech for SDK authentication.
sessionIdstring(optional) Unique ID used to track the entire flow traversed by the user in the OCR execution through logs. This field accepts up to 255 characters.
documentStepsZaigIosOcrDocumentFlow(required) Enumerator that describes which validation flow will be followed, defining which document and which image capture order will be performed.
backgroundColorstring(optional) Hexadecimal color of the screen background. If not provided, the default is #FFFFFF.
fontColorstring(optional) Hexadecimal color of the font. If not provided, the default is #000000.
fontFamilyFontFamily(optional) Font family. If not provided, the default is .open_sans. Available fonts: .open_sans, .futura, .verdana, .trebuchetms, .tamilsangammn and .system_font.
showIntroductionScreensboolean(optional) Flag that indicates whether the introduction screens, with instructions on how the photo should be captured, should be shown. If not provided, the default is true.
showSuccessScreenboolean(optional) Flag that indicates whether the success screen, with the success message in the capture, should be shown. If not provided, the default is true.
logLevelLogLevel(optional) Used to customize the verbosity level of the SDK logs. Available levels: LogLevel.debug, LogLevel.info, LogLevel.warn, LogLevel.error and LogLevel.trace. If not provided, the default is LogLevel.debug.

In the table below you will find all methods accepted by the instance for configuration:

methodargumentsdescription
setVisualConfigurationvisualConfiguration : VisualConfiguration(optional) Class that allows modification of images displayed during SDK execution;
setTextConfigurationtextConfiguration : TextConfiguration(optional) Class that allows modification of texts displayed during SDK execution;