Deprecation warning

Please note that this is outdated documentation for an older release of the Scandit Barcode Scanner SDK.

We are deprecating the 5.x API on all platforms (except Linux). Release 5.19 in April 2021 will be our final. Applications running 5.x will continue to work, and we will continue to release critical bug fixes and security patches only, for one year. We encourage you to migrate to 6.x and take advantage of our latest / advanced features and improved performance.

You'll find the updated documentation at: Data Capture SDK Documentation for iOS

SBSBarcodePicker.h
Go to the documentation of this file.
1 //
2 // SBSBarcodePicker.h
3 // ScanditBarcodeScanner
4 //
5 // Created by Marco Biasini on 12/06/15.
6 // Copyright (c) 2015 Scandit AG. All rights reserved.
7 //
8 
9 #import <UIKit/UIKit.h>
10 #import <AVFoundation/AVFoundation.h>
11 #import <CoreGraphics/CoreGraphics.h>
12 #import <CoreVideo/CoreVideo.h>
13 #import <CoreMedia/CoreMedia.h>
14 #import "SBSCommon.h"
15 #import "SBSParser.h"
16 #import "SBSParserDataFormat.h"
17 
18 
19 @class SBSScanSession;
20 @class SBSScanSettings;
21 @class SBSBarcodePicker;
23 @protocol SBSPropertyObserver;
24 
32 
50 - (void)barcodePicker:(nonnull SBSBarcodePicker *)barcodePicker
51  didProcessFrame:(nonnull CMSampleBufferRef)frame
52  session:(nonnull SBSScanSession *)session;
53 
54 @end
55 
65 @protocol SBSScanDelegate
66 
83 - (void)barcodePicker:(nonnull SBSBarcodePicker *)picker didScan:(nonnull SBSScanSession *)session;
84 
85 @end
86 
88 
99 - (void)barcodePicker:(nonnull SBSBarcodePicker *)picker failedToValidateLicense:(nonnull NSString *)errorMessage;
100 
101 @end
102 
143 @interface SBSBarcodePicker : UIViewController
144 
158 @property (nonatomic, assign) UIInterfaceOrientationMask allowedInterfaceOrientations;
159 
168 @property (nonnull, nonatomic, strong) SBSOverlayController *overlayController;
169 
181 @property (nullable, nonatomic, weak) id<SBSScanDelegate> scanDelegate;
182 
193 @property (nullable, nonatomic, weak) id<SBSProcessFrameDelegate> processFrameDelegate;
194 
204 @property (nullable, nonatomic, weak) id<SBSLicenseValidationDelegate> licenseValidationDelegate;
205 
211 @property (readonly, nonatomic) SBSCameraFacingDirection cameraFacingDirection;
212 
224 @property (nonatomic, assign) AVCaptureVideoOrientation cameraPreviewOrientation;
225 
232 @property (nonatomic, assign) BOOL autoFocusOnTapEnabled;
233 
243 @property (nonatomic, assign) BOOL pinchToZoomEnabled;
244 
261 - (nonnull instancetype)initWithSettings:(nullable SBSScanSettings *)settings SBS_DESIGNATED_INITIALIZER;
262 
265 
281 - (void)applyScanSettings:(nonnull SBSScanSettings *)settings
282  completionHandler:(nullable void (^)(void))handler;
283 
285 
296 - (void)addPropertyObserver:(nullable id<SBSPropertyObserver>)observer SBS_SWIFT_NAME(addPropertyObserver(_:));
297 
307 - (void)removePropertyObserver:(nullable id<SBSPropertyObserver>)observer SBS_SWIFT_NAME(removePropertyObserver(_:));
308 
311 
324 - (void)startScanning;
325 
341 - (void)startScanningInPausedState:(BOOL)paused;
342 
361 - (void)startScanningInPausedState:(BOOL)paused completionHandler:(nullable void (^)(void))handler;
362 
373 - (void)stopScanningWithCompletionHandler:(nullable void (^)(void))handler;
374 
384 - (void)stopScanning;
385 
399 - (void)resumeScanning;
400 
416 - (void)resumeScanningWithCompletionHandler:(nullable void (^)(void))handler;
417 
429 - (void)pauseScanning;
430 
444 - (void)pauseScanningWithCompletionHandler:(nullable void (^)(void))handler;
445 
447 
450 
468 - (CGPoint)convertPointToPickerCoordinates:(CGPoint)point;
469 
471 
479 - (BOOL)isScanning;
480 
482 
485 
495 - (BOOL)supportsCameraFacing:(SBSCameraFacingDirection)facing;
496 
505 - (BOOL)changeToCameraFacing:(SBSCameraFacingDirection)facing;
506 
514 - (BOOL)switchCameraFacing;
516 
519 
532 - (void)switchTorchOn:(BOOL)on;
534 
537 
550 - (BOOL)setRelativeZoom:(float)zoom;
552 
555 
569 - (nullable SBSParser *)parserForFormat:(SBSParserDataFormat)dataFormat error:(NSError * _Nullable * _Nullable)outError;
571 
572 @end
void resumeScanning()
Resume scanning codes.
Definition: SBSBarcodePicker.h:87
void pauseScanning()
Pause scanning but keep preview on.
Controls the camera and orchestrates the barcode scanning process.
Definition: SBSBarcodePicker.h:143
BOOL pinchToZoomEnabled
Whether pinch to zoom is enabled.
Definition: SBSBarcodePicker.h:243
SBSCameraFacingDirection
Definition: SBSCommon.h:40
controls the scan screen user interface.
Definition: SBSOverlayController.h:103
BOOL autoFocusOnTapEnabled
Whether tapping on the screen should trigger an auto-focus.
Definition: SBSBarcodePicker.h:232
id< SBSScanDelegate > scanDelegate
The scan delegate for this barcode picker.
Definition: SBSBarcodePicker.h:181
Holds settings that affect the recognition of barcodes, such as enabled barcode symbologies, scanning hot spot etc.
Definition: SBSScanSettings.h:29
Defines the Protocol for a scan event delegate.
Definition: SBSBarcodePicker.h:65
void startScanning()
Starts/restarts the camera and the scanning process.
SBSCameraFacingDirection cameraFacingDirection
The facing direction of the used camera.
Definition: SBSBarcodePicker.h:211
Protocol for accessing the processed sample buffers.
Definition: SBSBarcodePicker.h:31
Holds all barcodes that were decoded in the current session.
Definition: SBSScanSession.h:39
id< SBSLicenseValidationDelegate > licenseValidationDelegate
The license validation delegate for this barcode picker.
Definition: SBSBarcodePicker.h:204
Defines the interface for a data string parser. Parsers are capable of parsing one particular data fo...
Definition: SBSParser.h:62
id< SBSProcessFrameDelegate > processFrameDelegate
The process frame delegate for this barcode picker.
Definition: SBSBarcodePicker.h:193
BOOL switchCameraFacing()
Changes to the opposite camera facing if it is supported.
SBSOverlayController * overlayController
The overlay controller controls the scan user interface.
Definition: SBSBarcodePicker.h:168
AVCaptureVideoOrientation cameraPreviewOrientation
The orientation of the camera preview.
Definition: SBSBarcodePicker.h:224
UIInterfaceOrientationMask allowedInterfaceOrientations
Orientations that the barcode picker is allowed to rotate to.
Definition: SBSBarcodePicker.h:158
BOOL isScanning()
Returns YES if scanning is in progress.
void stopScanning()
Stop scanning and the video preview.