Barcode Selection
Defined in framework ScanditBarcodeCapture
- BarcodeSelection
open class BarcodeSelection : NSObject, DataCaptureMode
Added in version 6.6.0
Data capture mode that implements barcode selection.
Learn more on how to use Barcode Selection in our Get Started guide.
- init
convenience init(context: DataCaptureContext?, settings: BarcodeSelectionSettings)
Added in version 6.6.0
Constructs a new barcode selection mode with the provided context and settings. When the context is not null, the capture mode is automatically added to the context.
- init
convenience init(jsonString JSONString: String, context: DataCaptureContext) throws
Added in version 6.10.0
Construct a new barcode selection mode with the provided JSON serialization. The capture mode is automatically added to the context.
- isEnabled
open var isEnabled:
Bool{ get, set }Added in version 6.6.0
Implemented from DataCaptureMode. See DataCaptureMode.isEnabled.
- feedback
open var feedback: BarcodeSelectionFeedback { get, set }
Added in version 6.6.0
Instance of BarcodeSelectionFeedback that is used by barcode selection to notify users about the selection of a barcode.
The default instance of the Feedback will have the sound enabled but no vibration. A default click tone will be used for the sound.
To change the feedback emitted, the BarcodeSelectionFeedback can be modified as shown below, or a new one can be assigned.
let barcodeSelection: BarcodeSelection = ... barcodeSelection.feedback.selection = Feedback(vibration: nil, sound: Sound.default)
- context
open var context: DataCaptureContext? { get }
Added in version 6.6.0
Implemented from DataCaptureMode. See DataCaptureMode.context.
- pointOfInterest
open var pointOfInterest: PointWithUnit { get, set }
Added in version 6.6.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.
- apply
open func apply(_ settings: BarcodeSelectionSettings, completionHandler: (@Sendable () ->
Void)? = nil) ->VoidAdded in version 6.6.0
Asynchronously applies the new settings to the barcode selection. If the barcode selection is currently running, the task will complete when the next frame is processed, and will use the new settings for that frame. If the barcode selection 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.
- apply
open func apply(_ settings: BarcodeSelectionSettings) async ->
VoidAdded in version 6.6.0
Asynchronously applies the new settings to the barcode selection. If the barcode selection is currently running, the task will complete when the next frame is processed, and will use the new settings for that frame. If the barcode selection 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.
- recommendedCameraSettings
open class var recommendedCameraSettings: CameraSettings { get }
Added in version 6.6.0
Returns the recommended camera settings for use with barcode selection.
- addListener
open func addListener(_ listener: any BarcodeSelectionListener) ->
VoidAdded in version 6.6.0
Adds the listener to this barcode selection instance.
In case the same listener is already observing this instance, calling this method will not add the listener again.
- removeListener
open func removeListener(_ listener: any BarcodeSelectionListener) ->
VoidAdded in version 6.6.0
Removes a previously added listener from this barcode selection instance.
In case the listener is not currently observing this instance, calling this method has no effect.
- reset
open func reset() ->
VoidAdded in version 6.6.0
Asynchronously resets the barcode selection session, effectively clearing the history of selected codes.
- unfreezeCamera
open func unfreezeCamera() ->
VoidAdded in version 6.6.0
Unfreeze the camera.
- freezeCamera
open func freezeCamera() ->
VoidAdded in version 6.12.0
Freeze the camera.
- selectUnselectedBarcodes
open func selectUnselectedBarcodes() ->
VoidAdded in version 6.12.0
Select all the unselected barcodes that are being tracked in current the barcode selection session. This action is dispatched asynchronously and may happen on the next frame.
- selectAimedBarcode
open func selectAimedBarcode() ->
VoidAdded in version 6.16.0
Select the barcode being aimed at. Only use this with manual aimer selection.
- unselectBarcodes
open func unselectBarcodes(_ barcodes: Array<Barcode>) ->
VoidAdded in version 6.17.0
Remove the barcodes from the list of selected barcodes.
- unselectBarcodes
open func unselectBarcodes(fromJsonString json: String) ->
VoidAdded in version 6.17.0
Remove the barcodes contained in the given JSON string from the list of selected barcodes. The parameter json must be the JSON serialization of an object containing the barcodes inside an array named barcodes. For example:
{ "barcodes": [ { "data":"9783598215056", "rawData":"OTc4MzU5ODIxNTA1Ng==", "symbolCount":12, "symbology":"ean13Upca" } ] }
- increaseCount
open func increaseCount(for barcodes: Array<Barcode>) ->
VoidAdded in version 6.17.0
Increments the count of how many times the given barcodes have been selected.
- increaseCountForBarcodes
open func increaseCountForBarcodes(fromJsonString json: String) ->
VoidAdded in version 6.17.0
Increments the count of how many times the given barcodes have been selected. The parameter json must be the JSON serialization of an object containing the barcodes inside an array named barcodes. For example:
{ "barcodes": [ { "data":"9783598215056", "rawData":"OTc4MzU5ODIxNTA1Ng==", "symbolCount":12, "symbology":"ean13Upca" } ] }
- setSelect
open func setSelect(_ barcode: Barcode, enabled:
Bool) ->VoidAdded in version 6.17.0
Enables or disables the selection of a barcode.
- setSelectBarcodeFromJsonString
open func setSelectBarcodeFromJsonString(_ jsonString: String, enabled:
Bool) ->VoidAdded in version 6.17.0
Enables or disables the selection of the barcode represented by the given JSON string.
- update
open func update(fromJSONString JSONString: String) throws ->
VoidAdded in version 6.10.0
Updates the mode according to a JSON serialization.
- barcodeSelectionLicenseInfo
open var barcodeSelectionLicenseInfo: BarcodeSelectionLicenseInfo? { get }
Added in version 6.12.0
The object containing information about barcode selection licensing.
Note
This value is available with a small delay. To make sure it is available, set a DataCaptureContextListener and, as soon as DataCaptureContextListener.context() is called, this license object is available.