Barcode Selection Deserializer

Defined in framework ScanditBarcodeCapture

Warning

The deserialization API is not yet stable and will still change over the coming releases.

Note

This deserializer is not thread-safe, subsequent calls for the same settings, mode or overlay have to be called on the same thread.

BarcodeSelectionDeserializer
open class BarcodeSelectionDeserializer : NSObject, DataCaptureModeDeserializer

Added in version 6.10.0

A deserializer to construct barcode selection from JSON. For most use cases it is enough to use BarcodeSelection.init() which internally uses this deserializer. Using the deserializer gives the advantage of being able to listen to the deserialization events as they happen and potentially influence them. Additionally warnings can be read from the deserializer that would otherwise not be available.

init
init()

Added in version 6.10.0

Creates a new deserializer object.

delegate
open weak var delegate: BarcodeSelectionDeserializerDelegate? { get, set }

Added in version 6.10.0

The object informed about deserialization events.

warnings
open var warnings: Array<String> { get }

Added in version 6.10.0

The warnings produced during deserialization, for example which properties were not used during deserialization.

mode
open func mode(fromJSONString JSONString: String, with context: DataCaptureContext) throws -> BarcodeSelection

Added in version 6.10.0

Deserializes barcode selection from JSON.

An error is set if the provided JSON does not contain required properties or contains properties of the wrong type.

updateMode
open func updateMode(_ barcodeSelection: BarcodeSelection, fromJSONString JSONString: String) throws -> BarcodeSelection

Added in version 6.10.0

Takes an existing barcode selection and updates it by deserializing new or changed properties from JSON.

An error is set if the provided JSON does not contain required properties or contains properties of the wrong type.

settings
open func settings(fromJSONString JSONString: String) throws -> BarcodeSelectionSettings

Added in version 6.10.0

Deserializes barcode selection settings from JSON.

An error is set if the provided JSON does not contain required properties or contains properties of the wrong type.

update
open func update(_ settings: BarcodeSelectionSettings, fromJSONString JSONString: String) throws -> BarcodeSelectionSettings

Added in version 6.10.0

Takes existing barcode selection settings and updates them by deserializing new or changed properties from JSON.

An error is set if the provided JSON does not contain required properties or contains properties of the wrong type.

basicOverlay
open func basicOverlay(fromJSONString JSONString: String, withMode mode: BarcodeSelection) throws -> BarcodeSelectionBasicOverlay

Added in version 6.10.0

Deserializes a barcode selection basic overlay from JSON.

An error is set if the provided JSON does not contain required properties or contains properties of the wrong type.

update
open func update(_ overlay: BarcodeSelectionBasicOverlay, fromJSONString JSONString: String) throws -> BarcodeSelectionBasicOverlay

Added in version 6.10.0

Takes an existing barcode selection basic overlay and updates it by deserializing new or changed properties from JSON.

An error is set if the provided JSON does not contain required properties or contains properties of the wrong type.