Barcode Selection Session

Defined in framework ScanditBarcodeCapture

BarcodeSelectionSession
open class BarcodeSelectionSession : NSObject

Added in version 6.6.0

Holds the ongoing state of a running BarcodeSelection. An instance of this class is passed to BarcodeSelectionListener.barcodeSelection() when new barcodes are selected or currently selected barcodes are unselected.

Important

The barcode selection session should only be accessed from within barcodeSelection() to which it is provided as an argument. It is not safe to be accessed from anywhere else since it may be concurrently modified.

Specifically no reference to selectedBarcodes should be kept and traversed outside of barcodeSelection(). Instead a copy of the list should be made to avoid concurrent modification. The individual barcodes can be referenced without copying as they are not further modified.

newlySelectedBarcodes
open var newlySelectedBarcodes: Array<Barcode> { get }

Added in version 6.6.0

List of codes that were newly selected in the last processed frame.

newlyUnselectedBarcodes
open var newlyUnselectedBarcodes: Array<Barcode> { get }

Added in version 6.6.0

List of codes that were unselected in the last processed frame.

selectedBarcodes
open var selectedBarcodes: Array<Barcode> { get }

Added in version 6.6.0

List of currently selected codes.

selectUnselectedBarcodes
open func selectUnselectedBarcodes() -> Void

Added in version 6.12.0

Select all the unselected barcodes that are currently being tracked in this barcode selection session.

reset
open func reset() -> Void

Added in version 6.6.0

Resets the barcode selection session, effectively clearing the history of selected codes. This function should only be called inside the listeners’ callback. To call it from another thread, use BarcodeSelection.reset().

count
open func count(for barcode: Barcode) -> Int

Added in version 6.6.0

Returns how many times the given Barcode was selected.

frameSequenceId
open var frameSequenceId: Int { get }

Added in version 6.6.0

The identifier of the current frame sequence.

Important

As long as there is no interruptions of frames coming from the camera, the frameSequenceId will stay the same.

lastProcessedFrameId
open var lastProcessedFrameId: Int { get }

Added in version 6.6.0

The identifier of the last processed frame.

jsonString
open var jsonString: String { get }

Added in version 6.10.0

Returns the JSON representation of the barcode selection session.