Barcode Capture
Defined in framework ScanditBarcodeCapture
- SDCBarcodeCapture
@interface SDCBarcodeCapture : NSObject <SDCDataCaptureMode>
Added in version 6.0.0
Capture mode for single barcode scanning. This capture mode uses the barcode scanning capability.
Learn more on how to use barcode capture in our Get Started guide.
For MatrixScan-based barcode capture, use SDCBarcodeBatch instead.
It cannot be used together with other capture modes that require the same capabilities, e.g. SDCBarcodeBatch or SDCLabelCapture.
- + barcodeCaptureWithContext:settings:
+ (
instancetype
)barcodeCaptureWithContext:(nullable SDCDataCaptureContext *)context settings:(nonnull SDCBarcodeCaptureSettings *)settingsAdded in version 6.0.0
Construct a new barcode capture mode with the provided context and settings. When the context is not nil, the capture mode is automatically added to the context.
- + barcodeCaptureFromJSONString:context:error:
+ (nullable
instancetype
)barcodeCaptureFromJSONString:(nonnull NSString *)JSONString context:(nonnull SDCDataCaptureContext *)context error:(NSError **)errorAdded in version 6.0.0
Construct a new barcode capture mode with the provided JSON serialization. The capture mode is automatically added to the context.
- enabled
@property (nonatomic, assign, getter=isEnabled)
BOOL
enabledAdded in version 6.0.0
Implemented from SDCDataCaptureMode. See SDCDataCaptureMode.enabled.
- pointOfInterest
@property (nonatomic, assign) SDCPointWithUnit pointOfInterest
Added in version 6.1.0
The point of interest overwriting the point of interest of the data capture view. By default, this overwriting point of interest is not set and the one from the data capture view is used.
Use SDCPointWithUnitNull (FloatWithUnit.null in Swift) to unset the point of interest.
The overwriting point of interest is used to control the center of attention for the following subsystems:
Location selection. When no location selection is set, the point of interest defines the location at which the recognition optimizes for reading barcodes.
Rendered viewfinders.
- - applySettings:completionHandler:
- (
void
)applySettings:(nonnull SDCBarcodeCaptureSettings *)settings completionHandler:(nullable void (^)(void
))completionHandlerAdded in version 6.0.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.
- feedback
@property (nonatomic, strong, nonnull) SDCBarcodeCaptureFeedback *feedback
Added in version 6.0.0
Instance of SDCBarcodeCaptureFeedback that is used by the barcode scanner to notify users about Success and Failure events.
The default instance of the Feedback will have both sound and vibration enabled. A default beep sound will be used for the sound.
To change the feedback emitted, the SDCBarcodeCaptureFeedback can be modified as shown below, or a new one can be assigned.
let barcodeCapture: BarcodeCapture = ... barcodeCapture.feedback.success = Feedback(vibration: nil, sound: Sound.default)
- - addListener:
- (
void
)addListener:(nonnull id<SDCBarcodeCaptureListener>)listenerAdded in version 6.0.0
Adds the listener to this barcode 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<SDCBarcodeCaptureListener>)listenerAdded in version 6.0.0
Removes a previously added listener from this barcode capture instance.
In case the listener is not currently observing this instance, calling this method has no effect.
- recommendedCameraSettings
@property (class, nonatomic, nonnull, readonly) SDCCameraSettings *recommendedCameraSettings
Added in version 6.1.0
Returns the recommended camera settings for use with barcode capture.
- context
@property (nonatomic, nullable, readonly) SDCDataCaptureContext *context
Added in version 6.0.0
Implemented from SDCDataCaptureMode. See SDCDataCaptureMode.context.
- - updateFromJSONString:error:
- (
BOOL
)updateFromJSONString:(nonnull NSString *)JSONString error:(NSError **)errorAdded in version 6.0.0
Updates the mode according to a JSON serialization.
- barcodeCaptureLicenseInfo
@property (nonatomic, nullable, readonly) SDCBarcodeCaptureLicenseInfo *barcodeCaptureLicenseInfo
Added in version 6.12.0
The object containing information about barcode capture licensing.
Note
This value is available with a small delay. To make sure it is available, set a SDCDataCaptureContextListener and, as soon as SDCDataCaptureContextListener.context:didAddMode: is called, this license object is available.