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.

  • Informs the delegate about capturing barcode image. Fires only if barcodeImageGenerationType behavior parameter is not SBSDKBarcodeImageGenerationTypeNone

    Implementing this delegate function will use the new Scanbot barcode detector: see ‘SBSDKBarcodeType’.

    Declaration

    Objective-C

    - (void)qrBarcodeDetectionViewController:
                (nonnull SBSDKUIBarcodeScannerViewController *)viewController
                      didCaptureBarcodeImage:(nullable UIImage *)barcodeImage
                                    imageURL:(nullable NSURL *)imageURL;

    Swift

    optional func qrBarcodeDetectionViewController(_ viewController: SBSDKUIBarcodeScannerViewController, didCaptureBarcodeImage barcodeImage: UIImage?, imageURL: URL?)

    Parameters

    viewController

    The detection view controller that detected barcode(s).

    barcodeImage

    A device-orientation-corrected barcode image.

    imageURL

    URL, where frameImage is saved. Stored in default storage of SBSDKUIBarcodeImageStorage.

  • 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.

  • 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 *)
        qrBarcodeDetectionViewController:
            (nonnull SBSDKUIBarcodeScannerViewController *)viewController
                 selectionOverlayTextFor:(nonnull SBSDKBarcodeScannerResult *)code;

    Swift

    optional func qrBarcodeDetectionViewController(_ viewController: SBSDKUIBarcodeScannerViewController, selectionOverlayTextFor code: SBSDKBarcodeScannerResult) -> String?

    Parameters

    viewController

    The calling SBSDKUIBarcodeScannerViewController.

    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. If you return nil, the default string is used (barcode content and type).

  • 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