ScannerStatus
public enum ScannerStatus : Equatable
Represents the various states a barcode scanner can be in.
-
The scanner is not active or has been reset. This is the initial state or the state after
stopMonitoring()
orreset()
.Declaration
Swift
case idle
-
The scanner is initialized, connected (if applicable for hardware scanners), and ready to start scanning or be triggered. For VisionKit, this means camera permissions are granted and the scanner is ready to be presented. For hardware scanners, this typically means a connection is established.
Declaration
Swift
case ready
-
The scanner is actively trying to detect and decode barcodes. For VisionKit, the camera view is active and processing frames. For hardware scanners, they are typically listening for trigger events or actively emitting scan beams.
Declaration
Swift
case scanning
-
An error has occurred. The associated
ScannerError
provides more details about the nature of the failure.Declaration
Swift
case error(ScannerError)
-
A readable description of the status.
Declaration
Swift
public var description: String { get }