SBSDKMachineReadableCodeMetadata

@interface SBSDKMachineReadableCodeMetadata : NSObject

A class that holds transformed metadata for a detected AVMetadataMachineReadableCodeObject. Pass these objects to SBSDKMachineReadableCodeManager to parse and transform them into more user-friendly representations.

  • The designated initializer.

    Declaration

    Objective-C

    - (instancetype)initWithAVMetaDataCodeObject:
        (AVMetadataMachineReadableCodeObject *)codeObject;

    Swift

    init!(avMetaDataCodeObject codeObject: AVMetadataMachineReadableCodeObject!)
  • Convenience class initializer.

    Declaration

    Objective-C

    + (instancetype)metadataWithAVMetaDataCodeObject:
        (AVMetadataMachineReadableCodeObject *)codeObject;
  • The AVMetadataMachineReadableCodeObject we got from AVCaptureMetadataOutput.

    Declaration

    Objective-C

    @property (readonly, nonatomic) AVMetadataMachineReadableCodeObject *codeObject;

    Swift

    var codeObject: AVMetadataMachineReadableCodeObject! { get }
  • Returns the transformed bounds of the code in the video frame. Unified coordinates (0.0f, 0.0f) - (1.0f, 1.0f).

    Declaration

    Objective-C

    @property (readonly, nonatomic) CGRect bounds;

    Swift

    var bounds: CGRect { get }
  • Returns the transformed corners of the code in the video frame. CGPoint is encoded in NSDictionary. Unified coordinates (0.0f, 0.0f) - (1.0f, 1.0f).

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic) NSArray<NSDictionary *> *corners;

    Swift

    var corners: [[AnyHashable : Any]]! { get }
  • The string value of the detected code object.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic) NSString *stringValue;

    Swift

    var stringValue: String! { get }
  • Returns the transformed center of the bounds of the QR code in the video frame. Unified coordinates (0.0f, 0.0f) - (1.0f, 1.0f).

    Declaration

    Objective-C

    - (CGPoint)center;

    Swift

    func center() -> CGPoint
  • Returns the transformed normalized distance of the bounds center from the video frame center.

    Declaration

    Objective-C

    - (CGFloat)distanceFromCenter;

    Swift

    func distanceFromCenter() -> CGFloat