Spark Capture#

Defined in framework ScanditBarcodeCapture

Note

The Spark Capture API is still in beta and may change in future versions of the Scandit Data Capture SDK.

SDCSparkCapture#
@interface SDCSparkCapture : NSObject <SDCDataCaptureMode>

Added in version 6.8.0

Capture mode that implements spark capture.

This capture mode uses the barcode scanning capability. It cannot be used together with other capture modes that require the same capabilities, e.g. SDCBarcodeCapture.

+ sparkCaptureWithContext:settings:#
+ (instancetype)sparkCaptureWithContext:(nullable SDCDataCaptureContext *)context
                               settings:(nonnull SDCSparkCaptureSettings *)settings

Added in version 6.8.0

Construct a new spark capture mode with the provided context and settings. When the context is not nil, the capture mode is automatically added to the context.

enabled#
@property (nonatomic, assign, getter=isEnabled) BOOL enabled

Added in version 6.8.0

Implemented from SDCDataCaptureMode. See SDCDataCaptureMode.enabled.

- applySettings:completionHandler:#
- (void)applySettings:(nonnull SDCSparkCaptureSettings *)settings
    completionHandler:(nullable void (^)(void))completionHandler

Added in version 6.8.0

Asynchronously applies the new settings to the barcode scanner. If the scanner is currently running, the task will complete when the next frame is processed, and will use the new settings for that frame. If the scanner is currently not running, the task will complete as soon as the settings have been stored and won’t wait until the next frame is going to be processed.

context#
@property (nonatomic, nullable, readonly) SDCDataCaptureContext *context

Added in version 6.8.0

Implemented from SDCDataCaptureMode. See SDCDataCaptureMode.context.

- addListener:#
- (void)addListener:(nonnull id<SDCSparkCaptureListener>)listener

Added in version 6.8.0

Adds the listener to this spark capture instance.

In case the same listener is already observing this instance, calling this method will not add the listener again. The listener is stored using a weak reference and must thus be retained by the caller for it to not go out of scope.

- removeListener:#
- (void)removeListener:(nonnull id<SDCSparkCaptureListener>)listener

Added in version 6.8.0

Removes a previously added listener from this spark capture instance.

In case the listener is not currently observing this instance, calling this method has no effect.

feedback#
@property (nonatomic, strong, nonnull) SDCSparkCaptureFeedback *feedback

Added in version 6.8.0

Instance of SDCSparkCaptureFeedback that is used by spark capture to notify users about a successful scan of a barcode.

To change the feedback emitted, the SDCSparkCaptureFeedback can be modified as shown below, or a new one can be assigned.

let sparkCapture: SparkCapture = ...
sparkCapture.feedback.success = Feedback(vibration: Vibration.impactHapticFeedback, sound: Sound.default)