Structured data extraction with ScanFlow on iOS

The scan flow also lets you create a scanner to extract structured data.

The scan flow is able to extract the following structured data:

  • bank details recognition (IBAN and BIC/SWIFT code scanning)
  • receipt scanning
  • business card scanning
  • readable code scanning

Prerequisites

This guide assumes that you have followed the simple integration guide.

Configure the scan flow for structured data recognition

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:

  • you turn off multiPage, generally you are only interested in scanning the structured data on the first page.
  • you turn on the 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
})

Access the recognized structured data

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)")
}

Barcode and QR-code scanning

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
})

Example

The Simple Demo shows how to use the scan flow to scan structured data.

© 2025 The Grizzly Labs. All rights reserved.