Migration Guide

This page contains guidance for migrating from one version to another

Migrating from v5.7 to v5.8

ProcessParams now have all properties exposed as NSNumber to support optionality for Objective-C.

For Swift:

If you setup ProcessParams using literals (such as true \ false, numbers, etc.) the Swift compiler will bridge those literals under the hood. But for cases where you need to use variables, you will have to add as NSNumber explicitly.

Example:

// Old ⛔️
DocReader.shared.processParams.barcodeTypes = [BarcodeType.QRCODE.rawValue, BarcodeType.AZTEC.rawValue]

// New ✅
DocReader.shared.processParams.barcodeTypes = [BarcodeType.QRCODE.rawValue as NSNumber, BarcodeType.AZTEC.rawValue as NSNumber]

For Objective-C:

Almost all ProcessParams properties are NSNumbernow. You will be required to prefix all the literals for NSNumber with @ sign.

Example:

[RGLDocReader shared].processParams.logs = @YES;
[RGLDocReader shared].processParams.barcodeParserType = @123;
[RGLDocReader shared].processParams.timeout = @20;

For more examples please take a look at the Custom settings article.

Migrating from v5.1 to v5.2

Errors are returned as NSError now.

The database has to be updated along with the SDK as it's a part of it.

Migrating from v5.0 to v5.1

Database

The database has to be updated along with the SDK as it's a part of it.

Migrating from v4.2 to v5.0

The DocReader class is a singleton now.

Custom settings

Custom settings should be declared in the following way:

DocReader.shared.processParams.scenario = "Mrz"
DocReader.shared.customization.showResultStatusMessages = true

For continuous getting the results the startNewSession() function should be invoked, i.e.:

...
switch action {
...
case .complete:
    // pause current scanning session
    DocReader.shared.isCameraSessionIsPaused = true
    
    // handle results
    ...
    // continue the scanning process
    DocReader.shared.startNewSession()
    DocReader.shared.isCameraSessionIsPaused = false
...
}
...

Document Type Result

documentType is an array now that contains information about each page that has been read.

Graphic Result

gf_DocumentRear was removed and gf_DocumentFront was renamed to gf_DocumentImage (see GraphicFieldType enum). In order to get the appropriate document side you should use the new property pageIndex, which is available in DocumentReaderGraphicResult class, e.g. pageIndex = 0 - it’s the first (front) side of the document, pageIndex = 1 - it’s the second (back) side of the document.

Last updated

Was this helpful?