Speed up SparkScan integration with Agent Skills
Install the Scandit plugin and use the /sparkscan-ios skill so that your AI coding agent can integrate, debug, and customize SparkScan on iOS following Scandit's recommended patterns. More info →
Run the following command in your project directory. It detects the supported coding agents you have installed and adds the Scandit plugin to each. Re-run it to update.
npx plugins add scandit/skillsPrefer to set it up yourself? Manual installation steps for each agent →
SparkScan settings reference
This page lists the SparkScan settings and view properties on iOS, with their defaults and allowed values as the API reference states them. A blank default means the API reference states none. For what the workflow settings do for your users, see How SparkScan works.
Options
SparkScanSettings
SparkScanSettings holds the scanning settings, such as the enabled symbologies. To change them on a running scanner, pass them to SparkScan.apply(_:completionHandler:).
| Name | Type | Default | Values | What it does |
|---|---|---|---|---|
init(capturePresets:) | Initializer | CapturePreset | Creates settings from presets that enable the matching symbologies and optimizations. | |
codeDuplicateFilter | TimeInterval | -2 | -2: depends on scanIntention. -1: not reported again until scanning stops. 0: no filtering. Greater than 0: seconds before the same code is reported again. | Filters out codes with the same symbology and data that are scanned again within the interval. If you keep the default and turn the selection mode On, SparkScan doesn't filter duplicates, so users can select the same barcode again. |
enabledSymbologies | Set<Symbology> | Empty: all symbologies are disabled | Read-only. The enabled symbologies. | |
set(symbology:enabled:) | Method | Enables or disables one symbology. | ||
enableSymbologies(_:) | Method | Enables a set of symbologies. | ||
settings(for:) | Method | Returns the SymbologySettings of one symbology, for example to change its active symbol counts. | ||
enabledCompositeTypes | CompositeType | The composite code types to scan. Added in 8.3.0. | ||
enableSymbologies(forCompositeTypes:) | Method | Enables the symbologies that the given composite types need. Added in 8.3.0. | ||
batterySaving | BatterySavingMode | .auto | .on, .off, .auto | The battery saving mode. .auto turns it on when battery use is higher than usual. |
scanIntention | ScanIntention | .smart | .smart, .manual | Whether SparkScan identifies the barcode the user intends to scan. It has no effect while selectionMode is .on. |
selectionMode | SelectionMode | .auto | .auto, .on, .off | Whether users confirm the aimed barcode with the trigger button. Added in 8.5.0. |
itemDefinitions | [ScanItemDefinition]? | Configures the settings with the item-based scanning API. When set, enabledSymbologies is ignored. Beta. | ||
set(value:forProperty:) | Method | Sets a property that isn't part of the stable API yet. | ||
value(forProperty:) | Method | Returns the value of a property set with set(value:forProperty:). |
SparkScanViewSettings
SparkScanViewSettings sets the view's default look and behavior. Set them before you create the SparkScanView.
| Name | Type | Default | Values | What it does |
|---|---|---|---|---|
triggerButtonCollapseTimeout | TimeInterval | 5 seconds | A negative value means no timeout. | Time after which the view switches to the idle state. |
inactiveStateTimeout | TimeInterval | 10 seconds | Time after which the scanner stops capturing. | |
scanningBehavior | SparkScanScanningBehavior | .single | .single, .continuous | Whether the view scans one barcode per trigger or keeps scanning. Added in 8.5.0. |
previewBehavior | SparkScanPreviewBehavior | .default | .default, .persistent | Whether the preview hides after a scan or stays visible. Added in 8.5.0. |
defaultTorchState | TorchState | .off | .on, .off, .auto | The torch state when the camera starts. |
isSoundEnabled | Bool | true | Whether the scan feedback plays a sound. | |
isHapticEnabled | Bool | true | Whether the scan feedback vibrates. | |
isHoldToScanEnabled | Bool | true | Whether users can scan continuously by touching & holding the trigger button. Ignored while selectionMode is .on. | |
isHardwareTriggerEnabled | Bool | false | Whether the volume button starts scanning. | |
isVisualFeedbackEnabled | Bool | true | Whether the screen flashes after a scan. | |
toastSettings | SparkScanToastSettings | The text and colors of the toast messages. | ||
selectionModeCandidateBrush | Brush? | nil uses the default brush. | The brush for candidate barcodes while selectionMode is .auto. Added in 8.5.0. | |
zoomFactorOut | CGFloat | 1 | The camera zoom factor. | |
zoomFactorIn | CGFloat | 2 | The zoom factor after users tap the zoom switch control. | |
defaultMiniPreviewSize | SparkScanMiniPreviewSize | .regular | .regular, .expanded | The size of the mini preview. |
defaultCameraPosition | CameraPosition | .worldFacing | .worldFacing, .userFacing, .unspecified | The camera the view starts with. Beta. |
isPeriscopeModeEnabled | Bool | false | Mirrors the camera feed for use with a periscope device. | |
jsonString | String | Read-only. The settings as JSON. |
SparkScanView properties
SparkScanView properties change the view after you create it.
| Name | Type | Default | Values | What it does |
|---|---|---|---|---|
feedbackDelegate | SparkScanFeedbackDelegate? | Decides the feedback for each scanned barcode. Without a delegate, SparkScan gives success feedback. | ||
uiDelegate | SparkScanViewUIDelegate? | Receives toolbar button taps and view state changes. | ||
isTriggerButtonVisible | Bool | true | Shows the trigger button. | |
isZoomSwitchControlVisible | Bool | true | Shows the zoom switch control. | |
isPreviewSizeControlVisible | Bool | true | Shows the mini preview size control. | |
isTorchControlVisible | Bool | true | Shows the torch control. Hidden when defaultTorchState is .auto. | |
isPreviewCloseControlVisible | Bool | true | Shows the mini preview close control. | |
isSelectionModeButtonVisible | Bool | false | Shows the toolbar button that switches selectionMode between .on and .off. Added in 8.5.0. | |
isScanningBehaviorButtonVisible | Bool | false | Shows the toolbar button for the scanning behavior. | |
isBarcodeCountButtonVisible | Bool | false | Shows the toolbar button for MatrixScan Count. | |
isBarcodeFindButtonVisible | Bool | false | Shows the toolbar button for MatrixScan Find. | |
isLabelCaptureButtonVisible | Bool | false | Shows the toolbar button for Smart Label Capture. | |
isCameraSwitchButtonVisible | Bool | false | Shows the camera switch button. Beta. | |
triggerButtonCollapsedColor | UIColor? | The trigger button's background color when collapsed. | ||
triggerButtonExpandedColor | UIColor? | The trigger button's background color when expanded. | ||
triggerButtonAnimationColor | UIColor? | The color of the pulsing animation around the trigger button while scanning. | ||
triggerButtonTintColor | UIColor? | The trigger button's tint color. | ||
triggerButtonImage | UIImage? | The image on the trigger button. | ||
toolbarBackgroundColor | UIColor? | #121619CC | The toolbar's background color. | |
toolbarIconActiveTintColor | UIColor? | #FBC02C | The color of active toolbar icons. | |
toolbarIconInactiveTintColor | UIColor? | #FFFFFF | The color of inactive toolbar icons. | |
defaultBrush | Brush | Read-only class property. The default brush of the overlay. |
Framework differences
On iOS, these options differ from the other SparkScan frameworks:
isHardwareTriggerEnabledstarts scanning with the volume button only. On Android, you pick the button withhardwareTriggerKeyCode.isPeriscopeModeEnabledis available on iOS. Android and Web don't have a periscope mode.- The API reference states the toolbar color defaults:
#121619CC,#FBC02Cand#FFFFFF. For Android, Web, .NET Android, Cordova, Capacitor, React Native, Flutter and Kotlin Multiplatform, it statesnull.