Note

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

Barcode Definition

Defined in framework ScanditBarcodeCapture

BarcodeDefinition
class BarcodeDefinition : NSObject, ScanComponentDefinition

Added in version 8.0.0

A class that holds the definition for a barcode expected to be scanned as part of a certain ScanItemDefinition.

You can use the builder pattern to configure a barcode definition:

let barcodeIdentifier = BarcodeIdentifier()
let definition = BarcodeDefinition(barcodeIdentifier, symbologies: [.code128])
  .optional(false)
  .valueRegexes(["123.*", "789.*"])
  .anchorRegexes(["Identifier"])
init
init(_ identifier: BarcodeIdentifier, symbologies: Set<Symbology>)

Added in version 8.0.0

A constructor that receives the identifier and symbologies for the barcode definition.

identifier
var identifier: BarcodeIdentifier { get }

Added in version 8.0.0

The unique identifier for this component.

location
var location: Quadrilateral? { get, set }

Added in version 8.0.0

The expected location of the barcode.

optional
var optional: Bool { get, set }

Added in version 8.0.0

Whether the barcode is optional.

Symbologies
var symbologies: Set<Symbology> { get }

Added in version 8.0.0

The list of symbologies that the barcode could be using.

valueRegexes
var valueRegexes: Array<String> { get, set }

Added in version 8.0.0

A list of value regexes to use when searching for the barcode.

anchorRegexes
var anchorRegexes: Array<String> { get, set }

Added in version 8.0.0

A list of anchor regexes to use when searching for the barcode.

valueRegexes
func valueRegexes(_ valueRegexes: Array<String>) -> Self

Added in version 8.0.0

Sets the value regexes and returns the instance for method chaining.

anchorRegexes
func anchorRegexes(_ anchorRegexes: Array<String>) -> Self

Added in version 8.0.0

Sets the anchor regexes and returns the instance for method chaining.