SparkScan Listener

Defined in framework ScanditBarcodeCapture

SDCSparkScanListener
@protocol SDCSparkScanListener <NSObject>

Added in version 6.8.0

Delegate protocol for traditional SparkScan.

- sparkScan:didScanInSession:frameData:
- (void)sparkScan:(SDCSparkScan *)sparkScan
 didScanInSession:(SDCSparkScanSession *)session
        frameData:(nullable id<SDCFrameData>)frameData

Added in version 6.8.0

Invoked whenever a code has been scanned. The newly scanned barcode can be retrieved from SDCSparkScanSession.newlyRecognizedBarcode.

This method is invoked from a recognition internal thread. To perform UI work, you must dispatch to the main thread first. After receiving this callback, you will typically want to start processing the scanned barcodes. Keep in mind however, that any further recognition is blocked until this method completes. Therefore, if you need to perform a time-consuming operation, like querying a database or opening an URL encoded in the barcode data, consider switching to another thread.

Sometimes, after receiving this callback, you may want to stop scanning. You can do that by disabling the SparkScan.

SDCFrameData is nil if the camera is frozen and the selection is changed.

- sparkScan:didUpdateSession:frameData:
- (void)sparkScan:(SDCSparkScan *)sparkScan
 didUpdateSession:(SDCSparkScanSession *)session
        frameData:(nullable id<SDCFrameData>)frameData

Added in version 6.8.0

Invoked after a frame has been processed by SparkScan and the session has been updated. In contrast to sparkScan:didScanInSession:frameData:, this method is invoked, regardless whether a code was scanned or not. If codes were recognized in this frame, this method is invoked after sparkScan:didScanInSession:frameData:.

This method is invoked from a recognition internal thread. To perform UI work, you must dispatch to the main thread first. Further recognition is blocked until this method completes. It is thus recommended to do as little work as possible in this method.

SDCFrameData is nil if the camera is frozen and the selection is changed.