BarcodeScannerDelegate
@MainActor
public protocol BarcodeScannerDelegate : AnyObject
A delegate protocol for receiving updates from a BarcodeScanner
instance.
-
Called when the status of the barcode scanner changes.
Declaration
Swift
@MainActor func barcodeScannerDidUpdateStatus(_ status: ScannerStatus, for sender: any BarcodeScanner)
Parameters
status
The new
ScannerStatus
.sender
The
BarcodeScanner
instance that reported the status change. -
Called when a barcode is successfully scanned and decoded.
Declaration
Swift
@MainActor func barcodeScannerDidReceiveBarcode(_ barcode: String, from sender: any BarcodeScanner)
Parameters
barcode
The string representation of the scanned barcode data.
sender
The
BarcodeScanner
instance that scanned the barcode.