Swift
Multiple Barcode Scanning
Multiple Barcode Scanning is a mode in the Vision SDK that allows you to scan and detect multiple barcodes within the camera frame simultaneously. This is useful in scenarios where several barcodes are present in a single image or view, and you want to capture all of them in one go.
Unlike single barcode scanning, this mode does not restrict detection to just one barcode. Instead, it returns an array of all valid barcodes detected within the scanning region, improving efficiency for batch processing or document scanning use cases.
⚙️ Configure the SDK
To enable single barcode scanning, you need to configure the Vision SDK using the configure
method:
🤖 Auto Mode Barcode Scanning
For automatic barcode capture, set the captureMode
to .auto
:
Configuration example:
✋ Manual Mode Barcode Scanning
For manual barcode capture, set the captureMode
to .manual
:
Configuration example:
🧭 Detection Indicators
To receive detection indicators (without actual values), implement the following delegate method:
text
: Indicates presence of textbarCode
: Indicates presence of a barcodeqrCode
: Indicates presence of a QR codedocument
: Indicates presence of a document
🔘 Enable Detection Indicators
You can toggle detection indicators as follows:
📦 Delegate Method for Barcode Values
When a barcode is successfully scanned, the following delegate method is called:
❗️Error Handling Delegate
If an error occurs during the barcode scanning process, the following delegate method will be triggered. You can implement this to handle any failures gracefully.
Use this method to log errors, display messages to the user, or perform recovery actions when scanning fails.
🧾 Barcode Object Structure
The DetectedBarcode
object returned in the delegate contains the following properties: