SBSDKBarcodeScanAndCountViewController

@interface SBSDKBarcodeScanAndCountViewController
    : SBSDKBaseScannerViewController

A UIViewController subclass to show a camera screen with the barcode detector. Screen also shows snap, scan more and reset buttons. The snap button starts the scanning when tapped. The scan more button can be used to scan more barcodes, the accumulated results are stored in countedBarcodes property. The reset button resets the scanner, and the stored accumulated results are also cleared. This class cannot be instanced from a storyboard. Instead it is installing itself as a child view controller onto a given parent view controller.

  • The delegate. See SBSDKBarcodeScanAndCountViewControllerDelegate protocol. Weak.

    Declaration

    Objective-C

    @property (nonatomic, weak, nullable) id<SBSDKBarcodeScanAndCountViewControllerDelegate> delegate;

    Swift

    weak var delegate: SBSDKBarcodeScanAndCountViewControllerDelegate? { get set }
  • Barcode types (EAN, DataMatrix, Aztec, QR, etc) that can be returned in didDetectBarcodes delegate method. The default value is nil, the common code types are being detected; see [SBSBDKBarcodeType commonTypes].

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) NSArray<SBSDKBarcodeType *> *acceptedBarcodeTypes;

    Swift

    var acceptedBarcodeTypes: [SBSDKBarcodeType]? { get set }
  • Filter for extended EAN and UPC barcodes. By default the filter is disabled (SBSDKBarcodesExtensionFilterNoFilter).

    Declaration

    Objective-C

    @property (nonatomic) SBSDKBarcodesExtensionFilter extensionFilter;

    Swift

    var extensionFilter: SBSDKBarcodesExtensionFilter { get set }
  • Additional parameters for tweaking the detection of barcodes.

    Declaration

    Objective-C

    @property (nonatomic, strong, nonnull) SBSDKBarcodeAdditionalParameters *additionalDetectionParameters;

    Swift

    var additionalDetectionParameters: SBSDKBarcodeAdditionalParameters { get set }
  • The barcode detector engine mode. The default value is SBSDKBarcodeEngineModeNextGen.

    Declaration

    Objective-C

    @property (nonatomic) SBSDKBarcodeEngineMode engineMode;

    Swift

    var engineMode: SBSDKBarcodeEngineMode { get set }
  • The barcode scan and count capture mode. The default value is SBSDKBarcodeScanAndCountCaptureModeVideoFrame.

    Declaration

    Objective-C

    @property (nonatomic) SBSDKBarcodeScanAndCountCaptureMode captureMode;

    Swift

    var captureMode: SBSDKBarcodeScanAndCountCaptureMode { get set }
  • Whether the shutter button is hidden or not. Defaults to NO.

    Declaration

    Objective-C

    @property (nonatomic) BOOL shutterButtonHidden;

    Swift

    var shutterButtonHidden: Bool { get set }
  • The default style for the polygon around the barcodes. Defaults to blueish-green style.

    Declaration

    Objective-C

    @property (nonatomic, strong) SBSDKScanAndCountPolygonStyle *_Nonnull polygonStyle;

    Swift

    var polygonStyle: SBSDKScanAndCountPolygonStyle { get set }
  • Stores all the scanned barcode results accumulated through multiple scans. The storage is cleared only after the reset method has been called.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSArray<SBSDKBarcodeScannerAccumulatingResult *> *_Nonnull countedBarcodes;

    Swift

    var countedBarcodes: [SBSDKBarcodeScannerAccumulatingResult] { get }
  • Installs the receiver as child view controller onto the parent view controllers view using its entire bounds area.

    Declaration

    Objective-C

    - (nullable instancetype)initWithParentViewController:
                                 (nonnull UIViewController *)parentViewController
                                               parentView:
                                                   (nonnull UIView *)containerView;

    Swift

    init?(parentViewController: UIViewController, parentView containerView: UIView)

    Parameters

    parentViewController

    The view controller the newly created instance is embedded into.

    containerView

    The view the newly created instance is embedded into. If parentViewController conforms to SBSDKBarcodeScanAndCountViewControllerDelegate, it is automatically set as delegate.

  • Installs the receiver as child view controller onto the parent view controllers view using its entire bounds area.

    Declaration

    Objective-C

    - (nullable instancetype)
        initWithParentViewController:
            (nonnull UIViewController *)parentViewController
                          parentView:(nonnull UIView *)containerView
                            delegate:
                                (nullable id<
                                    SBSDKBarcodeScanAndCountViewControllerDelegate>)
                                    delegate;

    Swift

    init?(parentViewController: UIViewController, parentView containerView: UIView, delegate: SBSDKBarcodeScanAndCountViewControllerDelegate?)

    Parameters

    parentViewController

    The view controller the newly created instance is embedded into.

    containerView

    The view the newly created instance is embedded into.

    delegate

    The delegate for the receiver. If parentViewController conforms to SBSDKBarcodeScanAndCountViewControllerDelegate, it is automatically set as delegate.

  • Clears the countedBarcodes property.

    Declaration

    Objective-C

    - (void)clearCountedBarcodes;

    Swift

    func clearCountedBarcodes()
  • Extracts the image, freezes the camera and scans the image for barcodes.

    Declaration

    Objective-C

    - (void)scanAndCount;

    Swift

    func scanAndCount()
  • Resumes the camera and prepares the receiver for another scan.

    Declaration

    Objective-C

    - (void)continueScanning;

    Swift

    func continueScanning()