SparkScan View
Defined in framework ScanditBarcodeCapture
- SDCSparkScanScanningBehavior
Added in version 6.15.0
The capture mode type of the SDCSparkScanView.
- SDCSparkScanScanningBehaviorSingle
Added in version 6.15.0
Barcode capturing session is stopped after each scan.
- SDCSparkScanScanningBehaviorContinuous
Added in version 6.15.0
Keeps the barcode capturing session active for longer time.
- SDCSparkScanPreviewBehavior
Added in version 6.23.0
The preview behavior type of the SDCSparkScanView.
- SDCSparkScanPreviewBehaviorDefault
Added in version 6.23.0
After a scan with scanning behavior SDCSparkScanScanningBehaviorSingle, or stopping scanning with scanning behavior SDCSparkScanScanningBehaviorContinuous, camera moves to standby state and preview is hidden for maximum efficiency.
- SDCSparkScanPreviewBehaviorPersistent
Added in version 6.23.0
After a scan with scanning behavior SDCSparkScanScanningBehaviorSingle, or stopping scanning with scanning behavior SDCSparkScanScanningBehaviorContinuous, camera stays active and preview is visible for maximum precision.
- SDCSparkScanViewHandMode
Added in version 6.15.0
The hand mode type of the SDCSparkScanView.
Deprecated since version 7.0: Hand mode is no longer supported. The trigger button can now be placed anywhere on the screen.
- SDCSparkScanViewHandModeRight
Added in version 6.15.0
Optimizes the layout for right-hand use of the SDCSparkScanView.
- SDCSparkScanViewHandModeLeft
Added in version 6.15.0
Optimizes the layout for left-hand use of the SDCSparkScanView.
- SDCSparkScanMiniPreviewSize
Added in version 7.0.0
The size of the mini preview in SDCSparkScanView. Used in SDCSparkScanViewSettings.defaultMiniPreviewSize.
- SDCSparkScanMiniPreviewSizeRegular
Added in version 7.0.0
Regular, smaller size of the mini preview.
- SDCSparkScanMiniPreviewSizeExpanded
Added in version 7.0.0
Expanded, larger size of the mini preview.
- SDCSparkScanViewState
Added in version 7.0.0
The view state of SDCSparkScanView.
- SDCSparkScanViewStateInitial
Added in version 7.0.0
The initial view state for a few moments after SparkScanView is created.
- SDCSparkScanViewStateIdle
Added in version 7.0.0
SparkScan is displaying only the collapsed capture button.
- SDCSparkScanViewStateInactive
Added in version 7.0.0
SparkScan is displaying an expanded capture button, and if the SDCSparkScanPreviewBehavior of the current SparkScanScanningMode is SDCSparkScanPreviewBehaviorPersistent, we are also displaying camera feed through the mini preview but no actual scanning is taking place. This state is reachable after scanning or after a SDCSparkScanViewSettings.inactiveStateTimeout timeout.
- SDCSparkScanViewStateActive
Added in version 7.0.0
We are actively recognising barcodes, mini preview and expanded capture button are visible.
- SDCSparkScanViewStateError
Added in version 7.0.0
User returns SparkScanBarcodeFeedback.Error from the SDCSparkScanView.feedbackDelegate. Mini preview is visible with a frozen frame and expanded capture button is visible. If capture button is tapped or after a SDCSparkScanBarcodeErrorFeedback.resumeCapturingDelay timeout is reached we move to SDCSparkScanViewStateActive state.
- SDCSparkScanViewUIDelegate
@protocol SDCSparkScanViewUIDelegate <NSObject>
Added in version 6.16.0
- - barcodeFindButtonTappedInView:
- (
void
)barcodeFindButtonTappedInView:(nonnull SDCSparkScanView *)viewAdded in version 6.26.0
Callback method that can be used to define an action that should be performed when barcode find button is tapped from the toolbar. Called from the main thread.
- - barcodeCountButtonTappedInView:
- (
void
)barcodeCountButtonTappedInView:(nonnull SDCSparkScanView *)viewAdded in version 6.16.0
Callback method that can be used to define an action that should be performed when barcode count button is tapped from the toolbar. Called from the main thread.
- - labelCaptureButtonTappedInView:
- (
void
)labelCaptureButtonTappedInView:(nonnull SDCSparkScanView *)viewAdded in version 7.0.0
Callback method that can be used to define an action that should be performed when label capture button is tapped from the toolbar. Called from the main thread.
- - sparkScanView:didChangeScanningMode:
- (
void
)sparkScanView:(nonnull SDCSparkScanView *)view didChangeScanningMode:(nonnullid
<SDCSparkScanScanningMode>)scanningModeAdded in version 6.20.0
Callback method that will be called when the currently used SparkScanScanningMode changes. Called from the main thread.
- - sparkScanView:didChangeState:
- (
void
)sparkScanView:(nonnull SDCSparkScanView *)view didChangeState:(SDCSparkScanViewState)viewStateAdded in version 7.0.0
Callback method that will be called when SDCSparkScanViewState changes. Called from the main thread.
- SDCSparkScanScanningMode
@protocol SDCSparkScanScanningMode <NSObject>
Added in version 6.16.0
The base class for setting a default scanning mode to SDCSparkScanViewSettings. Can be either SDCSparkScanScanningModeTarget or SDCSparkScanScanningModeDefault.
- SDCSparkScanScanningModeTarget
@interface SDCSparkScanScanningModeTarget : NSObject <SDCSparkScanScanningMode>
Added in version 6.16.0
Target scanning mode. This is meant and optimized to scan codes further away.
- - initWithScanningBehavior:previewBehavior:
- (
instancetype
)initWithScanningBehavior:(SDCSparkScanScanningBehavior)scanningBehavior previewBehavior:(SDCSparkScanPreviewBehavior)previewBehaviorAdded in version 6.23.0
Constructs a new target scanning mode with the provided capture mode and preview behavior.
- scanningBehavior
@property (nonatomic, assign, readonly) SDCSparkScanScanningBehavior scanningBehavior
Added in version 6.16.0
The scanning mode provided in the constructor.
- previewBehavior
@property (nonatomic, assign, readonly) SDCSparkScanPreviewBehavior previewBehavior
Added in version 6.23.0
The preview behavior provided in the constructor.
- SDCSparkScanScanningModeDefault
@interface SDCSparkScanScanningModeDefault : NSObject <SDCSparkScanScanningMode>
Added in version 6.16.0
This is the standard scanning mode for SparkScan.
- - initWithScanningBehavior:previewBehavior:
- (
instancetype
)initWithScanningBehavior:(SDCSparkScanScanningBehavior)scanningBehavior previewBehavior:(SDCSparkScanPreviewBehavior)previewBehaviorAdded in version 6.23.0
Constructs a new default scanning mode with the provided capture mode and preview behavior.
- scanningBehavior
@property (nonatomic, assign, readonly) SDCSparkScanScanningBehavior scanningBehavior
Added in version 6.16.0
The scanning mode provided in the constructor.
- previewBehavior
@property (nonatomic, assign, readonly) SDCSparkScanPreviewBehavior previewBehavior
Added in version 6.23.0
The preview behavior provided in the constructor.
- SDCSparkScanView
@interface SDCSparkScanView : UIView
Added in version 6.15.0
SDCSparkScan comes with a ready-to-use UI and scanning modes that are purpose-built to tackle high-volume scanning at close range. The SparkScanView integrates with any app without requiring app redesign or customization. It includes:
camera preview screen
large-sized scan button
quick access toolbar to adjust scanning settings
- feedbackDelegate
@property (nonatomic, weak, nullable)
id
<SDCSparkScanFeedbackDelegate> feedbackDelegateAdded in version 6.23.0
Sets the feedback delegate. If no delegate is set, the default SparkScanBarcodeFeedback.Success feedback is emitted.
- - initWithParentView:context:sparkScan:settings:
- (
instancetype
)initWithParentView:(nonnull UIView *)parentView context:(nonnull SDCDataCaptureContext *)context sparkScan:(nonnull SDCSparkScan *)sparkScan settings:(nonnull SDCSparkScanViewSettings *)settingsAdded in version 6.15.0
Constructs a new SparkScan view and adds it to the provided parentView. When the settings are provided, those will be used to set the default behaviour and look of the view.
sparkScanView = SparkScanView(parentView: view, // For example the view controller's view property. context: context, sparkScan: sparkScan, settings: viewSettings)
- - prepareScanning
- (
void
)prepareScanningAdded in version 6.16.0
Method to call for preparing the mode for scanning. For instance, it can be called when the view controller containing SparkScanView is presented (i.e., UIViewController’s viewWillAppear).
Important
This method must be called before using the SparkScanView for scanning.
- - stopScanning
- (
void
)stopScanningAdded in version 6.16.0
Method to call for stopping the mode. For instance, it can be called when the view controller containing SparkScanView is about to disappear (i.e., UIViewController’s viewWillDisappear).
Important
This method must be called to ensure that all resources used by SparkScanView are released. If your workflow involves using other Scandit modes, call this method before switching to another mode.
- - startScanning
- (
void
)startScanningAdded in version 6.15.0
Starts the scanning process. You can call this method if you want to trigger the scanning process without any user interaction.
- - pauseScanning
- (
void
)pauseScanningAdded in version 6.15.0
Pauses the scanning process. You can call this method if you want to trigger pausing the scanning process without any user interaction.
- - showToast:
- (
void
)showToast:(NSString *)textAdded in version 6.18.0
Shows a toast with text inside the mini preview.
- scanningMode
@property (nonatomic, strong, readonly)
id
<SDCSparkScanScanningMode> scanningModeAdded in version 6.20.0
Returns the currently used SparkScanScanningMode.
- defaultBrush
@property (class, nonatomic, strong, nonnull, readonly) SDCBrush *defaultBrush
Added in version 6.16.0
Returns the default brush used by the overlay.
- UIDelegate
@property (nonatomic, weak, nullable)
id
<SDCSparkScanViewUIDelegate> UIDelegateAdded in version 6.16.0
Sets the delegate which is called whenever a barcode find button or barcode count button is tapped from the toolbar.
- barcodeCountButtonVisible
@property (nonatomic, assign, getter=isBarcodeCountButtonVisible)
BOOL
barcodeCountButtonVisibleAdded in version 6.16.0
Indicates whether the barcode count button should be shown to the user.
Default is NO.
- barcodeFindButtonVisible
@property (nonatomic, assign, getter=isBarcodeFindButtonVisible)
BOOL
barcodeFindButtonVisibleAdded in version 6.26.0
Indicates whether the barcode find button should be shown to the user.
Default is NO.
- labelCaptureButtonVisible
@property (nonatomic, assign, getter=isLabelCaptureButtonVisible)
BOOL
labelCaptureButtonVisibleAdded in version 7.0.0
Indicates whether the label capture button should be shown to the user.
Default is NO.
- targetModeButtonVisible
@property (nonatomic, assign, getter=isTargetModeButtonVisible)
BOOL
targetModeButtonVisibleAdded in version 6.16.0
Indicates whether the target mode button should be shown to the user.
Default is NO.
- scanningBehaviorButtonVisible
@property (nonatomic, assign, getter=isScanningBehaviorButtonVisible)
BOOL
scanningBehaviorButtonVisibleAdded in version 6.15.0
Indicates whether the scanning behavior button should be shown to the user.
Default is NO.
- torchButtonVisible
@property (nonatomic, assign, getter=isTorchButtonVisible)
BOOL
torchButtonVisibleAdded in version 6.15.0
Indicates whether the torch button should be shown to the user.
Default is YES.
Deprecated since version 7.0: The torch button has been moved to the mini preview. Use torchControlVisible instead.
- handModeButtonVisible
@property (nonatomic, assign, getter=isHandModeButtonVisible)
BOOL
handModeButtonVisibleAdded in version 6.15.0
Indicates whether the hand mode button should be shown to the user.
Default is NO.
Deprecated since version 7.0: Hand mode is no longer supported. The trigger button can now be placed anywhere on the screen.
- zoomSwitchControlVisible
@property (nonatomic, assign, getter=isZoomSwitchControlVisible)
BOOL
zoomSwitchControlVisibleAdded in version 6.18.0
Indicates whether the zoom switch control should be shown to the user.
Default is YES.
- triggerButtonVisible
@property (nonatomic, assign, getter=isTriggerButtonVisible)
BOOL
triggerButtonVisibleAdded in version 7.0.0
Indicates whether the trigger button should be shown to the user.
Default is YES.
- previewSizeControlVisible
@property (nonatomic, assign, getter=isPreviewSizeControlVisible)
BOOL
previewSizeControlVisibleAdded in version 6.23.0
Indicates whether the mini preview size control should be shown to the user.
Default is YES.
- torchControlVisible
@property (nonatomic, assign, getter=isTorchControlVisible)
BOOL
torchControlVisibleAdded in version 7.0.0
Indicates whether the torch control should be shown to the user.
Default is YES.
Note
If SDCSparkScanViewSettings.defaultTorchState is set to SDCTorchStateAuto, torch control is hidden.
- previewCloseControlVisible
@property (nonatomic, assign, getter=isPreviewCloseControlVisible)
BOOL
previewCloseControlVisibleAdded in version 7.0.0
Indicates whether the mini preview close control should be shown to the user.
Default is YES.
- cameraSwitchButtonVisible
@property (nonatomic, assign, getter=isCameraSwitchButtonVisible)
BOOL
cameraSwitchButtonVisibleAdded in version 6.24.0
Indicates whether the camera switch button should be shown to the user.
Default is NO.
Note
This API is still in beta and may change in future versions of Scandit Data Capture SDK.
- stopCapturingText
@property (nonatomic, strong, nullable) NSString *stopCapturingText
Added in version 6.15.0
Sets the default text to display in the button for the stop capturing action.
When scanning using hold-to-scan interaction default is “RELEASE TO STOP SCANNING” otherwise default is “STOP SCANNING”
Deprecated since version 7.0: The trigger button no longer displays text.
- startCapturingText
@property (nonatomic, strong, nullable) NSString *startCapturingText
Added in version 6.15.0
Sets the default text to display in the button for the start capturing action.
When SDCSparkScanViewSettings.holdToScanEnabled is enabled then default is “TAP OR HOLD TO SCAN” otherwise default is “TAP TO SCAN”
Deprecated since version 7.0: The trigger button no longer displays text.
- resumeCapturingText
@property (nonatomic, strong, nullable) NSString *resumeCapturingText
Added in version 6.15.0
Sets the default text to display in the button for the resume capturing action.
Default is “RESUME SCANNING”
Deprecated since version 7.0: The trigger button no longer displays text.
- scanningCapturingText
@property (nonatomic, strong, nullable) NSString *scanningCapturingText
Added in version 6.16.0
Sets the default text to display in the button when scanning in SDCSparkScanScanningBehaviorSingle.
Default is nil.
Deprecated since version 7.0: The trigger button no longer displays text.
- triggerButtonCollapsedColor
@property (nonatomic, strong, nullable) UIColor *triggerButtonCollapsedColor
Added in version 7.0.0
Sets the background color of the trigger button when button is collapsed.
- triggerButtonExpandedColor
@property (nonatomic, strong, nullable) UIColor *triggerButtonExpandedColor
Added in version 7.0.0
Sets the background color of the trigger button when button is expanded.
- triggerButtonAnimationColor
@property (nonatomic, strong, nullable) UIColor *triggerButtonAnimationColor
Added in version 7.0.0
Sets the color of the pulsing animation around the trigger button, which is shown when the scanner is active.
- triggerButtonTintColor
@property (nonatomic, strong, nullable) UIColor *triggerButtonTintColor
Added in version 7.0.0
Sets the trigger button tint color.
- captureButtonBackgroundColor
@property (nonatomic, strong, nullable) UIColor *captureButtonBackgroundColor
Added in version 6.15.0
Sets the background color of the capture button.
Default is #12161999.
Deprecated since version 7.0: Use triggerButtonCollapsedColor and triggerButtonExpandedColor instead.
- captureButtonActiveBackgroundColor
@property (nonatomic, strong, nullable) UIColor *captureButtonActiveBackgroundColor
Added in version 6.16.0
Sets the background color of the capture button when scanning.
Default is #12161966.
Deprecated since version 7.0: This property is not relevant anymore.
- captureButtonTintColor
@property (nonatomic, strong, nullable) UIColor *captureButtonTintColor
Added in version 6.16.0
Sets the capture button icon and text color.
Default is #FFFFFF.
Deprecated since version 7.0: Use triggerButtonTintColor instead.
- toolbarBackgroundColor
@property (nonatomic, strong, nullable) UIColor *toolbarBackgroundColor
Added in version 6.16.0
Sets the toolbar background color.
Default is #121619CC.
- toolbarIconActiveTintColor
@property (nonatomic, strong, nullable) UIColor *toolbarIconActiveTintColor
Added in version 6.16.0
Sets the toolbar icon active color.
Default is #FBC02C.
- NSStringFromSDCSparkScanViewState(viewState)
NSString *_Nonnull NSStringFromSDCSparkScanViewState(SDCSparkScanViewState viewState)
Added in version 7.0.0
Serialize the SparkScan view state in a JSON string.