Label Capture Listener
Defined in framework ScanditLabelCapture
- LabelCaptureListener
protocol LabelCaptureListener : NSObjectProtocol
Added in version 6.0.0
Interface to be implemented by listeners that want to observe a label capture mode and get informed whenever new labels have been captured, existing labels have been updated or lost.
This listener is essential to the Smart Label Capture workflow, providing callbacks for handling label recognition events and processing captured field data. Best practices include disabling the capture mode after successful recognition and using background processing for result handling.
Key responsibilities include:
Handling captured labels - Process complete labels and their field data
Managing capture lifecycle - Disable mode after successful capture to prevent duplicate results
Providing user feedback - Give immediate feedback on successful captures
Optional field handling - Process both mandatory and optional fields gracefully
- labelCapture
open func labelCapture(_ labelCapture: LabelCapture, didUpdate session: LabelCaptureSession, frameData: any FrameData) ->
VoidAdded in version 6.0.0
Invoked after label capture has processed a frame. The session contains a list of the currently captured labels, including both complete and incomplete labels being tracked. The list may be empty when no labels are currently detected.
Use this callback to:
Check for newly completed labels using CapturedLabel.isComplete
Extract data from captured label fields
Implement application-specific logic for handling captured labels
- didStartObserving
optional func didStartObserving(_ labelCapture: LabelCapture) ->
VoidAdded in version 6.0.0
Invoked when the listener starts observing the label capture instance.
- didStopObserving
optional func didStopObserving(_ labelCapture: LabelCapture) ->
VoidAdded in version 6.0.0
Invoked when the listener stops observing the label capture instance.