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) SBSDKPolygon *_Nonnull polygon;
Swift
var polygon: SBSDKPolygon { get set }
-
The barcodes type.
Declaration
Objective-C
@property (nonatomic, strong, readonly) SBSDKBarcodeType *_Nonnull type;
Swift
var type: SBSDKBarcodeType { get }
-
The barcodes extension string or nil.
Declaration
Objective-C
@property (nonatomic, strong, readonly) NSString *_Nonnull extension;
Swift
var `extension`: String { get }
-
A perspective corrected image of the barcode.
Declaration
Objective-C
@property (nonatomic, strong, readonly) UIImage *_Nonnull barcodeImage;
Swift
var barcodeImage: UIImage { get }
-
The source image where the barcode has been detected on.
Declaration
Objective-C
@property (nonatomic, strong, readonly, nullable) UIImage *sourceImage;
Swift
var sourceImage: 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, readonly) NSData *_Nonnull rawBytes;
Swift
var rawBytes: Data { get }
-
The formatted result object depending on scanned barcodes document type (if supported).
Declaration
Objective-C
@property (nonatomic, strong, readonly) SBSDKBarCodeScannerDocumentFormat *_Nonnull formattedResult;
Swift
var formattedResult: SBSDKBarCodeScannerDocumentFormat { get }
-
The date when this barcode has been detected the last time.
Declaration
Objective-C
@property (nonatomic, strong) NSDate *_Nonnull dateOfDetection;
Swift
var dateOfDetection: Date { get set }
-
Time interval since the last detection.
Declaration
Objective-C
@property (nonatomic, readonly) NSTimeInterval age;
Swift
var age: TimeInterval { get }
-
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 sourceImage:(nullable UIImage *)sourceImage rawTextString:(nonnull NSString *)string rawBytes:(nonnull NSData *)rawBytes metadata:(nonnull NSDictionary *)metadata;
Swift
init(polygon poly: SBSDKPolygon, type: SBSDKBarcodeType, barcodeImage image: UIImage, sourceImage: UIImage?, rawTextString string: String, rawBytes: Data, metadata: [AnyHashable : Any])