SBSDKBarcodeScannerResult

@interface SBSDKBarcodeScannerResult : NSObject

This class encapsulates the result of a barcode detection.

  • SBSDKPolygon instance where the barcode was found.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) SBSDKPolygon *_Nonnull polygon;

    Swift

    var polygon: SBSDKPolygon { get }
  • The barcodes type.

    Declaration

    Objective-C

    @property (nonatomic, readonly) SBSDKBarcodeType *_Nonnull type;

    Swift

    var type: SBSDKBarcodeType { get }
  • A perspective corrected image of the barcode.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) UIImage *_Nonnull barcodeImage;

    Swift

    var barcodeImage: UIImage { get }
  • The raw content value of the found barcode.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSString *_Nonnull rawTextString;

    Swift

    var rawTextString: String { get }
  • The raw content value of the found barcode including an eventual extension from the metadata.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSString *_Nonnull rawTextStringWithExtension;

    Swift

    var rawTextStringWithExtension: String { get }
  • The raw content bytes of the found barcode.

    Declaration

    Objective-C

    @property (nonatomic, strong) NSData *_Nonnull rawBytes;

    Swift

    var rawBytes: Data { get set }
  • The formatted result object depending on scanned barcodes document type (if supported).

    Declaration

    Objective-C

    @property (nonatomic, strong) SBSDKBarCodeScannerDocumentFormat *_Nonnull formattedResult;

    Swift

    var formattedResult: SBSDKBarCodeScannerDocumentFormat { get set }
  • The metadata of the found barcode. Accessible via public keys e.g. metadata[SBSDKBarcodeMetadataEANUPCExtensionKey].

    Declaration

    Objective-C

    @property (nonatomic, strong) NSDictionary *_Nonnull metadata;

    Swift

    var metadata: [AnyHashable : Any] { get set }
  • Initializer

    Declaration

    Objective-C

    - (nonnull instancetype)initWithPolygon:(nonnull SBSDKPolygon *)poly
                                       type:(nonnull SBSDKBarcodeType *)type
                               barcodeImage:(nonnull UIImage *)image
                              rawTextString:(nonnull NSString *)string
                                   rawBytes:(nonnull NSData *)rawBytes
                                   metadata:(nonnull NSDictionary *)metadata;

    Swift

    init(polygon poly: SBSDKPolygon, type: SBSDKBarcodeType, barcodeImage image: UIImage, rawTextString string: String, rawBytes: Data, metadata: [AnyHashable : Any])