iOS Developer Library

Developer

AVFoundation Framework Reference AVMetadataMachineReadableCodeObject Class Reference

Options
Deployment Target:

On This Page
Language:

AVMetadataMachineReadableCodeObject

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

Inheritance


Conforms To


Import Statement


import AVFoundation @import AVFoundation;

Availability


Available in iOS 7.0 and later.
  • corners corners Property

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

    Declaration

    Swift

    var corners: [AnyObject]! { get }

    Objective-C

    @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.

    Import Statement

    import AVFoundation

    Availability

    Available in iOS 7.0 and later.

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

    Declaration

    Swift

    var stringValue: String! { get }

    Objective-C

    @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

    Import Statement

    import AVFoundation

    Availability

    Available in iOS 7.0 and later.

  • 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.

    Declaration

    Swift

    let AVMetadataObjectTypeUPCECode: NSString! let AVMetadataObjectTypeCode39Code: NSString! let AVMetadataObjectTypeCode39Mod43Code: NSString! let AVMetadataObjectTypeEAN13Code: NSString! let AVMetadataObjectTypeEAN8Code: NSString! let AVMetadataObjectTypeCode93Code: NSString! let AVMetadataObjectTypeCode128Code: NSString! let AVMetadataObjectTypePDF417Code: NSString! let AVMetadataObjectTypeQRCode: NSString! let AVMetadataObjectTypeAztecCode: NSString! let AVMetadataObjectTypeInterleaved2of5Code: NSString! let AVMetadataObjectTypeITF14Code: NSString! let AVMetadataObjectTypeDataMatrixCode: NSString!

    Objective-C

    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; NSString *const AVMetadataObjectTypeInterleaved2of5Code; NSString *const AVMetadataObjectTypeITF14Code; NSString *const AVMetadataObjectTypeDataMatrixCode;

    Constants

    • AVMetadataObjectTypeUPCECode

      AVMetadataObjectTypeUPCECode

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

      Available in iOS 7.0 and later.

    • AVMetadataObjectTypeCode39Code

      AVMetadataObjectTypeCode39Code

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

      Available in iOS 7.0 and later.

    • AVMetadataObjectTypeCode39Mod43Code

      AVMetadataObjectTypeCode39Mod43Code

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

      Available in iOS 7.0 and later.

    • AVMetadataObjectTypeEAN13Code

      AVMetadataObjectTypeEAN13Code

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

      Available in iOS 7.0 and later.

    • AVMetadataObjectTypeEAN8Code

      AVMetadataObjectTypeEAN8Code

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

      Available in iOS 7.0 and later.

    • AVMetadataObjectTypeCode93Code

      AVMetadataObjectTypeCode93Code

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

      Available in iOS 7.0 and later.

    • AVMetadataObjectTypeCode128Code

      AVMetadataObjectTypeCode128Code

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

      Available in iOS 7.0 and later.

    • AVMetadataObjectTypePDF417Code

      AVMetadataObjectTypePDF417Code

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

      Available in iOS 7.0 and later.

    • AVMetadataObjectTypeQRCode

      AVMetadataObjectTypeQRCode

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

      Available in iOS 7.0 and later.

    • AVMetadataObjectTypeAztecCode

      AVMetadataObjectTypeAztecCode

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

      Available in iOS 7.0 and later.

    • AVMetadataObjectTypeInterleaved2of5Code

      AVMetadataObjectTypeInterleaved2of5Code

      AVMetadataMachineReadableCodeObject instances generated from Interleaved 2 of 5 codes return this identifier as the type.

      Available in iOS 8.0 and later.

    • AVMetadataObjectTypeITF14Code

      AVMetadataObjectTypeITF14Code

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

      Available in iOS 8.0 and later.

    • AVMetadataObjectTypeDataMatrixCode

      AVMetadataObjectTypeDataMatrixCode

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

      Available in iOS 8.0 and later.

    Import Statement