SBSDKBarcodeScannerViewController
@interface SBSDKBarcodeScannerViewController : SBSDKBaseCameraViewController
UIViewController subclass showing a camera screen and barcode detector. 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 SBSDKBarcodeScannerViewControllerDelegate protocol. Weak.
Declaration
Objective-C
@property (nonatomic, weak, nullable) id<SBSDKBarcodeScannerViewControllerDelegate> delegate;
Swift
weak var delegate: SBSDKBarcodeScannerViewControllerDelegate? { get set }
-
Specifies the way of barcode images generation or disables this generation at all. Use, if you want to receive a full sized image with barcodes. Defaults to SBSDKBarcodeImageGenerationTypeNone.
Declaration
Objective-C
@property (nonatomic) SBSDKBarcodeImageGenerationType barcodeImageGenerationType;
Swift
var barcodeImageGenerationType: SBSDKBarcodeImageGenerationType { get set }
-
Machine code types (EAN, DataMatrix, Aztec, QR, etc) that can be returned in
didDetectBarcodes
delegate method. When nil or empty - all codes can be returned. Default is nil.Declaration
Objective-C
@property (nonatomic, strong, nullable) NSArray<SBSDKBarcodeType *> *acceptedBarcodeTypes;
Swift
var acceptedBarcodeTypes: [SBSDKBarcodeType]? { get set }
-
Bar code document types to limit detection results to. When nil or empty - all document can be returned. Default is nil.
Declaration
Objective-C
@property (nonatomic, strong, nullable) NSArray<SBSDKBarcodeDocumentType *> *acceptedDocumentTypes;
Swift
var acceptedDocumentTypes: [SBSDKBarcodeDocumentType]? { get set }
-
Specifies the amount of frames barcode scanner takes before detecting. Uses the sharpest frame. So setting more frames generally improves recognition quality, but reduces recognition speed. Keep in mind, that
detectionRate
also has influence on recognition speed, as it determines the amount of frames that can be read per second. Default to 5.Declaration
Objective-C
@property (nonatomic) NSInteger barcodeAccumulatedFramesCount;
Swift
var barcodeAccumulatedFramesCount: Int { get set }
-
A transparent view that lies over the preview layer. You can add custom UI here. Read-only.
Declaration
Objective-C
@property (nonatomic, strong, readonly, nonnull) UIView *HUDView;
Swift
var hudView: UIView { get }
-
Defines if barcodeScanner should use limiting frame for detection. Alternatively all camera frame will be used. Default is NO.
Declaration
Objective-C
@property (nonatomic) BOOL shouldUseFinderFrame;
Swift
var shouldUseFinderFrame: Bool { get set }
-
Defines the region of interest when scanning barcodes or other machine readable codes. Machine readable codes found outside this region of interest are discarded and ignored during detection. The property describes the aspect ratio (width / height) of the region of interest. This aspect ratio, in conjunction with the screen size and
capturingFrameMinimumInset
parameter, is used to create an absolute region of interest and render a view finder like rounded rectangle on screen. The 0 aspect ratio effectively disables the region of interest.Note: Only effective if
shouldUseFinderFrame
is set toYES
.Declaration
Objective-C
@property (nonatomic, strong) SBSDKAspectRatio *_Nonnull capturingFrameAspectRatio;
Swift
var capturingFrameAspectRatio: SBSDKAspectRatio { get set }
-
Defines a minimum inset for capturing frame. Default is 32 for all parameters.
Note: Only effective if
shouldUseFinderFrame
is set toYES
.Declaration
Objective-C
@property (nonatomic) UIEdgeInsets capturingFrameMinimumInset;
Swift
var capturingFrameMinimumInset: UIEdgeInsets { get set }
-
Background color of camera preview. Default is black. Can be nil.
Declaration
Objective-C
@property (nonatomic, strong, nullable) UIColor *previewBackgroundColor;
Swift
var previewBackgroundColor: UIColor? { get set }
-
Background color of the view finder. Default is white with 0.66 alpha. Must not be nil.
Declaration
Objective-C
@property (nonatomic, strong, nonnull) UIColor *viewFinderBackgroundColor;
Swift
var viewFinderBackgroundColor: UIColor { get set }
-
Line color of the view finder. Default is nil, which draws no border line for the view finder.
Declaration
Objective-C
@property (nonatomic, strong, nullable) UIColor *viewFinderLineColor;
Swift
var viewFinderLineColor: UIColor? { get set }
-
Line width of the view finder. Default is 2.
Declaration
Objective-C
@property (nonatomic) CGFloat viewFinderLineWidth;
Swift
var viewFinderLineWidth: CGFloat { get set }
-
The current rectangle of the view finder if displayed, CGRectZero otherwise.
Declaration
Objective-C
@property (nonatomic, readonly) CGRect currentViewFinderRect;
Swift
var currentViewFinderRect: CGRect { get }
-
Set to YES to toggle on the video light. Defaults to NO.
Declaration
Objective-C
@property (nonatomic) BOOL flashLightEnabled;
Swift
var flashLightEnabled: Bool { get set }
-
Not available.
Declaration
Objective-C
- (nonnull instancetype)init;
-
Not available.
Declaration
Objective-C
+ (nonnull instancetype)new;
-
Designated initializer. 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: (nullable UIView *)containerView;
Swift
init?(parentViewController: UIViewController, parentView containerView: UIView?)
Parameters
parentViewController
The view controller the newly created instance is embedded into. If parentViewController conforms to SBSDKBarcodeScannerViewControllerDelegate, it is automatically set as delegate.