SBSDKBarcodeScannerViewControllerDelegate
@protocol SBSDKBarcodeScannerViewControllerDelegate <NSObject>
A delegate protocol to customize the behavior, look and feel of the SBSDKBarcodeScannerViewControllerDelegate.
-
Informs the delegate that the receiver has detected some barcodes.
Declaration
Objective-C
- (void)barcodeScannerController: (nonnull SBSDKBarcodeScannerViewController *)controller didDetectBarcodes: (nonnull NSArray<SBSDKBarcodeScannerResult *> *)codes;
Swift
func barcodeScannerController(_ controller: SBSDKBarcodeScannerViewController, didDetectBarcodes codes: [SBSDKBarcodeScannerResult])
Parameters
controller
The calling SBSDKBarcodeScannerViewController.
codes
Array of SBSDKBarcodeScannerResult containing the detected barcodes.
-
Asks the delegate if the receiver should detect barcodes on the next video frame. Optional.
Declaration
Objective-C
- (BOOL)barcodeScannerControllerShouldDetectBarcodes: (nonnull SBSDKBarcodeScannerViewController *)controller;
Swift
optional func barcodeScannerControllerShouldDetectBarcodes(_ controller: SBSDKBarcodeScannerViewController) -> Bool
Parameters
controller
The calling SBSDKBarcodeScannerViewController.
Return Value
YES, if barcodes should be detected on the next video frame. No otherwise.
-
Asks the delegate to filter the detected barcodes. Optional.
Declaration
Objective-C
- (nonnull NSArray<SBSDKBarcodeScannerResult *> *) barcodeScannerController: (nonnull SBSDKBarcodeScannerViewController *)controller filterResults: (nonnull NSArray<SBSDKBarcodeScannerResult *> *)codes;
Swift
optional func barcodeScannerController(_ controller: SBSDKBarcodeScannerViewController, filterResults codes: [SBSDKBarcodeScannerResult]) -> [SBSDKBarcodeScannerResult]
Parameters
controller
The calling SBSDKBarcodeScannerViewController.
codes
Array of SBSDKBarcodeScannerResult containing the detected barcodes.
Return Value
The filtered array of barcodes to be delivered to the post-processing.
-
Informs the delegate that a barcode has been tapped on the barcode selection overlay. Optional. Is not called if the barcode selection overlay is disabled.
Declaration
Objective-C
- (void)barcodeScannerController: (nonnull SBSDKBarcodeScannerViewController *)controller didTapOnBarcode:(nonnull SBSDKBarcodeScannerResult *)code;
Swift
optional func barcodeScannerController(_ controller: SBSDKBarcodeScannerViewController, didTapOnBarcode code: SBSDKBarcodeScannerResult)
Parameters
controller
The calling SBSDKBarcodeScannerViewController.
code
The SBSDKBarcodeScannerResult the user has tapped on.
-
Asks the delegate whether to highlight a barcode on the selection overlay or not. Only called only when the selection overlay is enabled.
Declaration
Objective-C
- (BOOL)barcodeScannerController: (nonnull SBSDKBarcodeScannerViewController *)controller shouldHighlightResult:(nonnull SBSDKBarcodeScannerResult *)code;
Swift
optional func barcodeScannerController(_ controller: SBSDKBarcodeScannerViewController, shouldHighlight code: SBSDKBarcodeScannerResult) -> Bool
Parameters
controller
The calling SBSDKBarcodeScannerViewController.
code
The barcode scanner result that may be highlighted or not.
Return Value
YES, if the provided barcode result should be highlighted on the selection overlay. NO otherwise.
-
Asks the delegate for the string to be displayed for the given barcode result on the selection overlay. Only called only when the selection overlay is enabled.
Declaration
Objective-C
- (nullable NSString *) barcodeScannerController: (nonnull SBSDKBarcodeScannerViewController *)controller selectionOverlayTextFor:(nonnull SBSDKBarcodeScannerResult *)code;
Swift
optional func barcodeScannerController(_ controller: SBSDKBarcodeScannerViewController, selectionOverlayTextFor code: SBSDKBarcodeScannerResult) -> String?
Parameters
controller
The calling SBSDKBarcodeScannerViewController.
code
The barcode scanner result the returned text will be displayed for.
Return Value
A string to be displayed on the selection overlay for the given barcode result. Return an empty, non-nil string of you want to display no text. If you return nil, the text is automatically generated from the selectionOverlayTextFormat property. Otherwise the setting of the selectionOverlayTextFormat property is ignored.