SBSDKBarcodeScanAndCountViewControllerDelegate
@protocol SBSDKBarcodeScanAndCountViewControllerDelegate <NSObject>
A delegate protocol to handle barcode results from SBSDKBarcodeScanAndCountViewController.
-
Informs the delegate that the receiver has detected some barcodes.
Declaration
Objective-C
- (void)barcodeScanAndCountController: (nonnull SBSDKBarcodeScanAndCountViewController *)controller didDetectBarcodes: (nonnull NSArray<SBSDKBarcodeScannerResult *> *)codes;
Swift
func barcodeScanAndCount(_ controller: SBSDKBarcodeScanAndCountViewController, didDetectBarcodes codes: [SBSDKBarcodeScannerResult])
Parameters
controller
The calling SBSDKBarcodeScanAndCountViewController.
codes
Array of SBSDKBarcodeScannerResult containing the detected barcodes.
-
Asks the delegate to filter the detected barcodes. Optional.
Declaration
Objective-C
- (nonnull NSArray<SBSDKBarcodeScannerResult *> *) barcodeScanAndCountController: (nonnull SBSDKBarcodeScanAndCountViewController *)controller filterResults: (nonnull NSArray<SBSDKBarcodeScannerResult *> *)codes;
Swift
optional func barcodeScanAndCount(_ controller: SBSDKBarcodeScanAndCountViewController, filterResults codes: [SBSDKBarcodeScannerResult]) -> [SBSDKBarcodeScannerResult]
Parameters
controller
The calling SBSDKBarcodeScanAndCountViewController.
codes
Array of SBSDKBarcodeScannerResult containing the detected barcodes.
Return Value
The filtered array of barcodes to be delivered to the post-processing.
-
Asks the delegate to provide a custom barcode overlay polygon style for the given barcode. If not implemented, the default style is used. Optional. Is not called if a custom overlay is used.
Declaration
Objective-C
- (nonnull SBSDKScanAndCountPolygonStyle *) barcodeScanAndCountController: (nonnull SBSDKBarcodeScanAndCountViewController *)controller polygonStyleForBarcode:(nonnull SBSDKBarcodeScannerResult *)code;
Swift
optional func barcodeScanAndCount(_ controller: SBSDKBarcodeScanAndCountViewController, polygonStyleForBarcode code: SBSDKBarcodeScannerResult) -> SBSDKScanAndCountPolygonStyle
Parameters
controller
The calling SBSDKBarcodeScanAndCountViewController.
code
Instance of SBSDKBarcodeScannerResult containing the detected barcode.
Return Value
The style to draw the polygon.
-
Asks the delegate to provide the overlay view for a given code. If not implemented, a default green checkmark is drawn as an overlay. If implemented, but nil is returned for the given code, no overlay is drawn for that code. Optional.
Declaration
Objective-C
- (nullable UIView *) barcodeScanAndCountController: (nonnull SBSDKBarcodeScanAndCountViewController *)controller overlayForBarcode:(nonnull SBSDKBarcodeScannerResult *)code;
Swift
optional func barcodeScanAndCount(_ controller: SBSDKBarcodeScanAndCountViewController, overlayForBarcode code: SBSDKBarcodeScannerResult) -> UIView?
Parameters
controller
The calling SBSDKBarcodeScanAndCountViewController.
code
Instance of SBSDKBarcodeScannerResult containing the detected barcode.
Return Value
Overlay for the barcode as a UIView.
-
Informs the delegate when it starts scanning. Optional.
Declaration
Objective-C
- (void)barcodeScanAndCountControllerDidStartScanning: (nonnull SBSDKBarcodeScanAndCountViewController *)controller;
Swift
optional func barcodeScanAndCountControllerDidStartScanning(_ controller: SBSDKBarcodeScanAndCountViewController)