The scan flow also lets you create a scanner to extract structured data.
The scan flow is able to extract the following structured data:
This guide assumes that you have followed the simple integration guide.
To configure the scan flow for structured data, you need to configure the structured data type you are interested in extracting with the structuredData
property on the GSKScanFlowConfiguration
object.
We also recommend that:
multiPage
, generally you are only interested in scanning the structured data on the first page.skipPostProcessingScreen
option because you generally don’t need the user to review the scan.let configuration = GSKScanFlowConfiguration()
// You can specify a single or multiple structured data to extract
configuration.structuredData = [.bankDetails, .receipt, .businessCard]
configuration.multiPage = false
configuration.skipPostProcessingScreen = true
// Keep a strong reference on ScanFlow
self.scanFlow = GSKScanFlow(configuration: configuration)
scanFlow.start(from: viewController, onSuccess: { result in
// Handle result
}, failure: { error in
// Handle error
})
The recognized structured data is present in each scan of the result object:
// Handle result
if let iban = result.scans.first.structuredData?.bankDetails?.iban {
print("IBAN detected: \(iban)")
}
if let bic = result.scans.first.structuredData?.bankDetails?.bic {
print("BIC/SWIFT code detected: \(bic)")
}
Using readable code structured data extraction, the scan flow retrieves the values encoded in readable codes on each page of a scanned document. Additionally, you will receive an image of the scanned document.
To enable this feature, specify .readableCodes in the structuredData
field of the scan flow configuration. Additionally, you must specify the types of readable codes you want to extract using the structuredDataReadableCodeTypes
property. For a complete list of supported code types, refer to the API documentation for GSKStructuredDataReadableCodeType
.
let configuration = GSKScanFlowConfiguration()
configuration.structuredData = [.readableCodes]
configuration.structuredDataReadableCodeTypes = [.ean13]
configuration.multiPage = false
configuration.skipPostProcessingScreen = true
// Launch the scan flow
self.scanFlow = GSKScanFlow(configuration: configuration)
scanFlow.start(from: viewController, onSuccess: { result in
print("Detected readable codes: \(result.scans.first.structuredData?.readableCodes)")
}, failure: { error in
// Handle error
})
The Simple Demo shows how to use the scan flow to scan structured data.
© 2025 The Grizzly Labs. All rights reserved.