SBSDKUIBarcodeScannerViewControllerDelegate
@protocol
SBSDKUIBarcodeScannerViewControllerDelegate <SBSDKUIViewControllerDelegate>
Delegate protocol for ‘SBSDKUIBarcodeScannerViewController’.
-
Informs the delegate that one or more barcodes have been detected.
Implementing this delegate function will use the new Scanbot barcode detector: see ‘SBSDKBarcodeType’.
Declaration
Objective-C
- (void)qrBarcodeDetectionViewController: (nonnull SBSDKUIBarcodeScannerViewController *)viewController didDetectResults: (nonnull NSArray<SBSDKBarcodeScannerResult *> *) barcodeResults;
Swift
optional func qrBarcodeDetectionViewController(_ viewController: SBSDKUIBarcodeScannerViewController, didDetect barcodeResults: [SBSDKBarcodeScannerResult])
Parameters
viewController
The detection view controller that detected barcode(s).
barcodeResults
An array of SBSDKBarcodeScannerResult objects containing recently detected barcodes.
-
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)qrBarcodeDetectionViewController: (nonnull SBSDKUIBarcodeScannerViewController *)viewController shouldHighlightResult: (nonnull SBSDKBarcodeScannerResult *)code;
Swift
optional func qrBarcodeDetectionViewController(_ viewController: SBSDKUIBarcodeScannerViewController, shouldHighlight code: SBSDKBarcodeScannerResult) -> Bool
Parameters
viewController
The calling SBSDKUIBarcodeScannerViewController.
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.
-
Optional: informs the delegate that the ‘SBSDKUIBarcodeScannerViewController’ has been cancelled and dismissed.
Declaration
Objective-C
- (void)qrBarcodeDetectionViewControllerDidCancel: (nonnull SBSDKUIBarcodeScannerViewController *)viewController;
Swift
optional func qrBarcodeDetectionViewControllerDidCancel(_ viewController: SBSDKUIBarcodeScannerViewController)
Parameters
viewController
The ‘SBSDKUIBarcodeScannerViewController’ that did dismiss.
-
Optional: informs the delegate that the ‘SBSDKUIBarcodeScannerViewController’ has been cancelled and dismissed by timeout.
Declaration
Objective-C
- (void)qrBarcodeDetectionViewControllerDidTimeout: (nonnull SBSDKUIBarcodeScannerViewController *)viewController;
Swift
optional func qrBarcodeDetectionViewControllerDidTimeout(_ viewController: SBSDKUIBarcodeScannerViewController)
Parameters
viewController
The ‘SBSDKUIBarcodeScannerViewController’ that did dismiss. Note: If this method is not implemented, viewController will try to call
-(void)qrBarcodeDetectionViewControllerDidCancel:(nonnull SBSDKUIBarcodeScannerViewController *)viewController