Label Capture Basic Overlay Listener
Defined in framework ScanditLabelCapture
- LabelCaptureBasicOverlayDelegate
protocol LabelCaptureBasicOverlayDelegate : NSObjectProtocol
Added in version 6.0.0
LabelCaptureBasicOverlayDelegate can be implemented to customize the visual appearance of highlighted labels and their fields in the basic overlay. When label capture identifies a new field, or when the LabelField.state property changes, labelCaptureBasicOverlay() is called to determine the brush of the field.
- labelCaptureBasicOverlay
open func labelCaptureBasicOverlay(_ overlay: LabelCaptureBasicOverlay, brushFor field: LabelField, of label: CapturedLabel) -> Brush?
Added in version 6.0.0
Called to determine the visual style for a specific field when its state changes. This method allows you to provide custom styling based on field content, validation status, or other contextual information.
The method is called when a field is first detected, when its state changes (e.g., from predicted to captured), or when field data is updated. Return null to use the default brush for the field’s current state. The returned brush can be overridden by explicit calls to LabelCaptureBasicOverlay.setBrush().
- labelCaptureBasicOverlay
open func labelCaptureBasicOverlay(_ overlay: LabelCaptureBasicOverlay, brushFor label: CapturedLabel) -> Brush?
Added in version 6.0.0
Called to determine the visual style for a label when any of its fields change state or data. This method allows you to provide custom styling for entire labels based on their completion status, validation results, or other contextual information.
The method is called when any field within the label changes state or when field data is updated. Return null to use the default label brush. The returned brush can be overridden by explicit calls to LabelCaptureBasicOverlay.setBrush().
- labelCaptureBasicOverlay
open func labelCaptureBasicOverlay(_ overlay: LabelCaptureBasicOverlay, didTap label: CapturedLabel) ->
VoidAdded in version 6.4.0
Called when a user taps on a captured label in the overlay. This method allows you to handle user interactions with labels, such as showing detailed information, triggering validation flows, or providing additional options.
This method is called from the main thread, making it safe to perform UI operations directly.
If you are adding a UIGestureRecognizer to the data capture view, ensure that the cancelsTouchesInView property is set to false as otherwise tap gestures will be cancelled instead of successfully completing.