One Logo Pool Ball
Vision · IOS API REFERENCE

BarcodeObservation

struct · iOS 18.0+ · SDK 27.1

struct BarcodeObservation

Members (19)

get · iOS 18.0+

bottomLeft

TypeScript
get bottomLeft(): NormalizedPoint
Swift declaration
let bottomLeft: NormalizedPoint

The coordinates of the lower-left corner of the quadrilateral.

get · iOS 18.0+

confidence

TypeScript
get confidence(): number
Swift declaration
let confidence: Float

The level of confidence normalized to `[0, 1]` where `1` is most confident. The only exception is results coming from `CoreMLRequest`, where confidence values are forwarded as is from relevant CoreML models

get · iOS 18.0+

bottomRight

TypeScript
get bottomRight(): NormalizedPoint
Swift declaration
let bottomRight: NormalizedPoint

The coordinates of the lower-right corner of the quadrilateral.

get · iOS 18.0+

description

TypeScript
get description(): string
Swift declaration
var description: String { get }

A textual representation of this instance. Calling this property directly is discouraged. Instead, convert an instance of any type to a string by using the `String(describing:)` initializer. This initializer works with any type, and uses the custom `description` property for types that conform to `CustomStringConvertible`: struct Point: CustomStringConvertible { let x: Int, y: Int var description: String { return "(\(x), \(y))" } } let p = Point(x: 21, y: 30) let s = String(describing: p) print(s) // Prints "(21, 30)" The conversion of `p` to a string in the assignment to `s` uses the `Point` type's `description` property.

get · iOS 18.0+

payloadData

TypeScript
get payloadData(): (ArrayBuffer) | null
Swift declaration
let payloadData: Data?

The raw data representation of the barcode’s payload.

get · iOS 18.0+

payloadString

TypeScript
get payloadString(): (string) | null
Swift declaration
let payloadString: String?

A string value that represents the barcode payload. Depending on the symbology or the payload data itself, a string representation of the payload may not be available.

get · iOS 26.0+

boundingRegion

TypeScript
get boundingRegion(): ContoursObservation_Contour
Swift declaration
var boundingRegion: NormalizedRegion { get }

The bounding region of the barcode.

get · iOS 18.0+

isColorInverted

TypeScript
get isColorInverted(): boolean
Swift declaration
let isColorInverted: Bool

A Boolean value that indicates whether the barcode is color inverted.

get · iOS 18.0+

isGS1DataCarrier

TypeScript
get isGS1DataCarrier(): boolean
Swift declaration
let isGS1DataCarrier: Bool

A Boolean value that indicates whether the barcode carries any global standards data.

get · iOS 18.0+

supplementalPayloadData

TypeScript
get supplementalPayloadData(): (ArrayBuffer) | null
Swift declaration
let supplementalPayloadData: Data?

The raw data representation of the barcode’s supplemental payload.

get · iOS 18.0+

supplementalCompositeType

TypeScript
get supplementalCompositeType(): (BarcodeObservation_CompositeType) | null
Swift declaration
let supplementalCompositeType: BarcodeObservation.CompositeType?

The supplemental composite type. Currently, this can only refer to the composite flag of the 2D symbology as part of a GS1 composite symbology. This attribute only exists when the primary descriptor is the 1D symbology of a GS1 composite symbology, and of which a valid 2D counterpart has been coalesced into.

get · iOS 18.0+

supplementalPayloadString

TypeScript
get supplementalPayloadString(): (string) | null
Swift declaration
let supplementalPayloadString: String?

The supplemental code decoded as a string value.

get · iOS 18.0+

originatingRequestDescriptor

TypeScript
get originatingRequestDescriptor(): (RequestDescriptor) | null
Swift declaration
let originatingRequestDescriptor: RequestDescriptor?

The descriptor of the request that produced the observation.

get · iOS 18.0+

uuid

TypeScript
get uuid(): string
Swift declaration
let uuid: UUID

The unique identifier for the observation.

get · iOS 18.0+

topLeft

TypeScript
get topLeft(): NormalizedPoint
Swift declaration
let topLeft: NormalizedPoint

The coordinates of the upper-left corner of the quadrilateral.

get · iOS 18.0+

topRight

TypeScript
get topRight(): NormalizedPoint
Swift declaration
let topRight: NormalizedPoint

The coordinates of the upper-right corner of the quadrilateral.

get · iOS 18.0+

symbology

TypeScript
get symbology(): BarcodeSymbology
Swift declaration
let symbology: BarcodeSymbology

The symbology of the observed barcode.

get · iOS 18.0+

timeRange

TypeScript
get timeRange(): (_CoreMedia_CMTimeRange) | null
Swift declaration
let timeRange: CMTimeRange?

The time range of the reported observation. When evaluating a sequence of image buffers, use this property to determine each observation’s start time and duration.

init · iOS 18.0+

init

TypeScript
static init(observation: VNBarcodeObservation): BarcodeObservation
Swift declaration
init(_ observation: VNBarcodeObservation)

Skipped declarations

No declarations were skipped in this snapshot.

All Vision types →