Skip to main content
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/skills

Prefer 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:).

NameTypeDefaultValuesWhat it does
init(capturePresets:)InitializerCapturePresetCreates settings from presets that enable the matching symbologies and optimizations.
codeDuplicateFilterTimeInterval-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.
enabledSymbologiesSet<Symbology>Empty: all symbologies are disabledRead-only. The enabled symbologies.
set(symbology:enabled:)MethodEnables or disables one symbology.
enableSymbologies(_:)MethodEnables a set of symbologies.
settings(for:)MethodReturns the SymbologySettings of one symbology, for example to change its active symbol counts.
enabledCompositeTypesCompositeTypeThe composite code types to scan. Added in 8.3.0.
enableSymbologies(forCompositeTypes:)MethodEnables the symbologies that the given composite types need. Added in 8.3.0.
batterySavingBatterySavingMode.auto.on, .off, .autoThe battery saving mode. .auto turns it on when battery use is higher than usual.
scanIntentionScanIntention.smart.smart, .manualWhether SparkScan identifies the barcode the user intends to scan. It has no effect while selectionMode is .on.
selectionModeSelectionMode.auto.auto, .on, .offWhether 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:)MethodSets a property that isn't part of the stable API yet.
value(forProperty:)MethodReturns 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.

NameTypeDefaultValuesWhat it does
triggerButtonCollapseTimeoutTimeInterval5 secondsA negative value means no timeout.Time after which the view switches to the idle state.
inactiveStateTimeoutTimeInterval10 secondsTime after which the scanner stops capturing.
scanningBehaviorSparkScanScanningBehavior.single.single, .continuousWhether the view scans one barcode per trigger or keeps scanning. Added in 8.5.0.
previewBehaviorSparkScanPreviewBehavior.default.default, .persistentWhether the preview hides after a scan or stays visible. Added in 8.5.0.
defaultTorchStateTorchState.off.on, .off, .autoThe torch state when the camera starts.
isSoundEnabledBooltrueWhether the scan feedback plays a sound.
isHapticEnabledBooltrueWhether the scan feedback vibrates.
isHoldToScanEnabledBooltrueWhether users can scan continuously by touching & holding the trigger button. Ignored while selectionMode is .on.
isHardwareTriggerEnabledBoolfalseWhether the volume button starts scanning.
isVisualFeedbackEnabledBooltrueWhether the screen flashes after a scan.
toastSettingsSparkScanToastSettingsThe text and colors of the toast messages.
selectionModeCandidateBrushBrush?nil uses the default brush.The brush for candidate barcodes while selectionMode is .auto. Added in 8.5.0.
zoomFactorOutCGFloat1The camera zoom factor.
zoomFactorInCGFloat2The zoom factor after users tap the zoom switch control.
defaultMiniPreviewSizeSparkScanMiniPreviewSize.regular.regular, .expandedThe size of the mini preview.
defaultCameraPositionCameraPosition.worldFacing.worldFacing, .userFacing, .unspecifiedThe camera the view starts with. Beta.
isPeriscopeModeEnabledBoolfalseMirrors the camera feed for use with a periscope device.
jsonStringStringRead-only. The settings as JSON.

SparkScanView properties​

SparkScanView properties change the view after you create it.

NameTypeDefaultValuesWhat it does
feedbackDelegateSparkScanFeedbackDelegate?Decides the feedback for each scanned barcode. Without a delegate, SparkScan gives success feedback.
uiDelegateSparkScanViewUIDelegate?Receives toolbar button taps and view state changes.
isTriggerButtonVisibleBooltrueShows the trigger button.
isZoomSwitchControlVisibleBooltrueShows the zoom switch control.
isPreviewSizeControlVisibleBooltrueShows the mini preview size control.
isTorchControlVisibleBooltrueShows the torch control. Hidden when defaultTorchState is .auto.
isPreviewCloseControlVisibleBooltrueShows the mini preview close control.
isSelectionModeButtonVisibleBoolfalseShows the toolbar button that switches selectionMode between .on and .off. Added in 8.5.0.
isScanningBehaviorButtonVisibleBoolfalseShows the toolbar button for the scanning behavior.
isBarcodeCountButtonVisibleBoolfalseShows the toolbar button for MatrixScan Count.
isBarcodeFindButtonVisibleBoolfalseShows the toolbar button for MatrixScan Find.
isLabelCaptureButtonVisibleBoolfalseShows the toolbar button for Smart Label Capture.
isCameraSwitchButtonVisibleBoolfalseShows the camera switch button. Beta.
triggerButtonCollapsedColorUIColor?The trigger button's background color when collapsed.
triggerButtonExpandedColorUIColor?The trigger button's background color when expanded.
triggerButtonAnimationColorUIColor?The color of the pulsing animation around the trigger button while scanning.
triggerButtonTintColorUIColor?The trigger button's tint color.
triggerButtonImageUIImage?The image on the trigger button.
toolbarBackgroundColorUIColor?#121619CCThe toolbar's background color.
toolbarIconActiveTintColorUIColor?#FBC02CThe color of active toolbar icons.
toolbarIconInactiveTintColorUIColor?#FFFFFFThe color of inactive toolbar icons.
defaultBrushBrushRead-only class property. The default brush of the overlay.

Framework differences​

On iOS, these options differ from the other SparkScan frameworks:

  • isHardwareTriggerEnabled starts scanning with the volume button only. On Android, you pick the button with hardwareTriggerKeyCode.
  • isPeriscopeModeEnabled is available on iOS. Android and Web don't have a periscope mode.
  • The API reference states the toolbar color defaults: #121619CC, #FBC02C and #FFFFFF. For Android, Web, .NET Android, Cordova, Capacitor, React Native, Flutter and Kotlin Multiplatform, it states null.

Next step​

Choosing which barcode types to scan