Deprecation warning

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

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

SBSScanCase Class Reference

Inherits NSObject.

Instance Methods

(nonnull instancetype) - initWithSettings:delegate:
 
(void) - applySettings:completionHandler:
 
(void) - setTimeout:fromState:toState:
 
(void) - setTimeout:tolerance:fromState:toState:
 
(void) - removeTimeoutFromState:
 

Class Methods

(nonnull instancetype) + acquireWithSettings:delegate:
 

Properties

id< SBSScanCaseDelegatedelegate
 
SBSScanCaseState state
 
BOOL volumeButtonToScanEnabled
 
UIViewController * cameraPreview
 

Detailed Description

Start a scanner for the Scandit case.

SBSScanCase is a subclass of NSObject and it does not need to be added to the view hierarchy.

Example (minimal) usage:

// Set your app key on the license first.
[SBSLicense setAppKey:kScanditBarcodeScannerAppKey];
// Create the settings used for the scan case.
SBSScanCaseSettings *settings = [[SBSScanCaseSettings alloc] init];
// Enable symbologies etc.
[scanSettings setSymbology:SBSSymbologyEAN13 enabled:YES];
// Instantiate the scan case and keep a strong reference to it until needed.
self.scanCase = [SBSScanCase acquireWithSettings:settings delegate:self];
Since
4.13.0

Method Documentation

+ (nonnull instancetype) acquireWithSettings: (nullable SBSScanCaseSettings *)  settings
delegate: (nullable id< SBSScanCaseDelegate >)  delegate 

Initializes a new scan case.

Note that the initial invocation of this method will activate the Scandit Barcode Scanner SDK, after which the device will count towards your device limit.

Make sure to set the app key available from your Scandit account through setAppKey: (SBSLicense) before you call this initializer.

This is the recommended way to create a new SBSScanCase object.

Parameters
settingsThe scan settings to use. You may pass nil, which is identical to passing a settings instance constructed through defaultSettings (SBSScanSettings).
delegateThe scan case delegate.
Returns
The newly constructed scan case instance.
Since
4.13.0
- (nonnull instancetype) initWithSettings: (nullable SBSScanCaseSettings *)  settings
delegate: (nullable id< SBSScanCaseDelegate >)  delegate 

The designated initializer for instantiating a new scan case.

Note that the initial invocation of this method will activate the Scandit Barcode Scanner SDK, after which the device will count towards your device limit.

Make sure to set the app key available from your Scandit account through setAppKey: (SBSLicense) before you call this initializer.

Parameters
settingsThe scan settings to use. You may pass nil, which is identical to passing a settings instance constructed through defaultSettings (SBSScanSettings).
delegateThe scan case delegate.
Returns
The newly constructed scan case instance.
Since
4.13.0
- (void) applySettings: (nonnull SBSScanCaseSettings *)  settings
completionHandler: (nullable void(^)())  completionHandler 

Change the scan settings of an existing picker instance.

The scan settings are applied asynchronously after this call returns. You may use the completion handler to get notified when the settings have been applied to the picker. All frames processed after the settings have been applied will use the new scan settings.

Parameters
settingsThe new scan settings to apply.
completionHandlerAn optional block that will be invoked when the settings have been applied to the picker. The block will be invoked on an internal picker dispatch queue.
Since
4.13.0
- (void) setTimeout: (NSTimeInterval)  timeout
fromState: (SBSScanCaseState fromState
toState: (SBSScanCaseState toState 

Set a timeout to automatically change state after a specific interval.

Set a timer that is started whenever the state is changed to fromState. The timer will have a time interval equal to timeout and then it will switch the state of the scan case to toState. The timer will be created every time the state of the scan case is equal to fromState. At any given time there could not be more than one timeout for each fromState.

Note that this method is actually calling setTimeout:tolerance:fromState:toState: with 0 as tolerance. Please also note that in most of the cases it is better to set a tolerance higher than 0, as it gives the system more flexibility to schedule the firing date and increases responsiveness.

Parameters
timeoutThe interval of the timer.
fromStateThe state from which the timer should start.
toStateThe new state when the timer is fired.
Since
4.13.0
- (void) setTimeout: (NSTimeInterval)  timeout
tolerance: (NSTimeInterval)  tolerance
fromState: (SBSScanCaseState fromState
toState: (SBSScanCaseState toState 

Set a timeout to automatically change state after a specific interval.

Set a timer that is started whenever the state is changed to fromState. The timer will have a time interval equal to timeout and then it will switch the state of the scan case to toState. The timer will be created every time the state of the scan case is equal to fromState. At any given time there could not be more than one timeout for each fromState.

Please also note that in most of the cases it is better to set a tolerance higher than 0, as it gives the system more flexibility to schedule the firing date and increases responsiveness.

Parameters
timeoutThe interval of the timer.
toleranceThe tolerance of the timer.
fromStateThe state from which the timer should start.
toStateThe new state when the timer is fired.
Since
4.13.0
- (void) removeTimeoutFromState: (SBSScanCaseState fromState

Remove a previously set timeout.

Remove a previously set timeout to avoid starting a new timer when the state is changed to fromState.

Parameters
fromStateThe state from which the timer should start.
Since
4.13.0

Property Documentation

- (id<SBSScanCaseDelegate>) delegate
readwritenonatomicweak

The delegate for this scan case.

Since
4.13.0
- (SBSScanCaseState) state
readwritenonatomicassign

The state of the scan case.

Get or set the state of the scan case. Possible states:

After the initialization the default state is SBSScanCaseStateStandby.

Since
4.13.0
- (BOOL) volumeButtonToScanEnabled
readwritenonatomicassign

Turn on/off scanning via the volume button.

Set to YES to change the state of the scan case using the volume button (holding the volume button changes the state to SBSScanCaseStateActive, while releasing it changes the state to SBSScanCaseStateStandby). Set to NO to not control the state of the scan case via the volume button.

The default value is NO.

Since
4.13.0
- (UIViewController*) cameraPreview
readnonatomicstrong

The camera preview.

Use this accessor if you would like to display a camera preview when using the scan case.

Since
4.14

The documentation for this class was generated from the following file: