AVMetadataMachineReadableCodeObject Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/AVFoundation.framework
Availability
Available in iOS 7.0 and later.
Declared in
AVMetadataObject.h

Overview

The AVMetadataMachineReadableCodeObject class is a concrete subclass of AVMetadataObject defining the features of a detected one-dimensional or two-dimensional barcode.

An AVMetadataMachineReadableCodeObject instance represents a single detected machine readable code in an image.  It is an immutable object describing the features and payload of a barcode.

On supported platforms, the AVCaptureMetadataOutput class outputs arrays of detected machine readable code objects.

Tasks

Getting Machine Readable Code Values

Properties

corners

The points defining the (X,Y) locations of the corners. (read-only)

@property(readonly) NSArray *corners
Discussion

The value of this property is an array of CFDictionary objects, each of which has been created from a CGPoint struct using the CGPointCreateDictionaryRepresentation function, representing the coordinates of the corners of the object with respect to the image in which it resides.

If the metadata originates from video, the points may be expressed as scalar values from 0 to 1.

The points in the corners differ from the bounds rectangle in that bounds is axis aligned to orientation of the captured image, and the values of the corners reside within the bounds rectangle.

The points are arranged in counterclockwise order (clockwise if the code or image is mirrored), starting with the top left of the code in its canonical orientation.

Availability
  • Available in iOS 7.0 and later.
Declared In
AVMetadataObject.h

stringValue

Returns the error corrected data decoded into a human-readable string. (read-only)

@property(readonly) NSString *stringValue
Discussion

The value of this property is an NSString created by decoding the binary payload according to the format of the machine-readable code or nil if a string representation cannot be created

Availability
  • Available in iOS 7.0 and later.
Declared In
AVMetadataObject.h

Constants

Machine Readable Object Types

These constants are used in conjunction with the AVCaptureMetadataOutput class’s metadataObjectTypes property to specify the type (“symbology”) of barcode to scan. When a barcode is detected, the type property of AVMetadataMachineReadableCodeObject reflects the constant for the detected barcode's symbology.

 NSString *const AVMetadataObjectTypeUPCECode;
 NSString *const AVMetadataObjectTypeCode39Code;
 NSString *const AVMetadataObjectTypeCode39Mod43Code;
 NSString *const AVMetadataObjectTypeEAN13Code;
 NSString *const AVMetadataObjectTypeEAN8Code;
 NSString *const AVMetadataObjectTypeCode93Code;
 NSString *const AVMetadataObjectTypeCode128Code;
 NSString *const AVMetadataObjectTypePDF417Code;
 NSString *const AVMetadataObjectTypeQRCode;
 NSString *const AVMetadataObjectTypeAztecCode;
Constants
AVMetadataObjectTypeUPCECode

AVMetadataMachineReadableCodeObject instances generated from UPC-E codes return this identifier as the type.

Available in iOS 7.0 and later.

Declared in AVMetadataObject.h.

AVMetadataObjectTypeCode39Code

AVMetadataMachineReadableCodeObject instances generated from Code 39 codes return this identifier as the type.

Available in iOS 7.0 and later.

Declared in AVMetadataObject.h.

AVMetadataObjectTypeCode39Mod43Code

AVMetadataMachineReadableCodeObject instances generated from Code 39 mod 43 codes return this identifier as the type.

Available in iOS 7.0 and later.

Declared in AVMetadataObject.h.

AVMetadataObjectTypeEAN13Code

AVMetadataMachineReadableCodeObject instances generated from EAN-13 (including UPC-A) codes return this identifier as the type.

Available in iOS 7.0 and later.

Declared in AVMetadataObject.h.

AVMetadataObjectTypeEAN8Code

AVMetadataMachineReadableCodeObject instances generated from EAN-8 codes return this identifier as the type.

Available in iOS 7.0 and later.

Declared in AVMetadataObject.h.

AVMetadataObjectTypeCode93Code

AVMetadataMachineReadableCodeObject instances generated from Code 93 codes return this identifier as the type.

Available in iOS 7.0 and later.

Declared in AVMetadataObject.h.

AVMetadataObjectTypeCode128Code

AVMetadataMachineReadableCodeObject instances generated from Code 128 codes return this identifier as the type.

Available in iOS 7.0 and later.

Declared in AVMetadataObject.h.

AVMetadataObjectTypePDF417Code

AVMetadataMachineReadableCodeObject instances generated from PDF417 codes return this identifier as the type.

Available in iOS 7.0 and later.

Declared in AVMetadataObject.h.

AVMetadataObjectTypeQRCode

AVMetadataMachineReadableCodeObject instances generated from QR codes return this identifier as the type.

Available in iOS 7.0 and later.

Declared in AVMetadataObject.h.

AVMetadataObjectTypeAztecCode

AVMetadataMachineReadableCodeObject instances generated from Aztec codes return this identifier as the type.

Available in iOS 7.0 and later.

Declared in AVMetadataObject.h.