Main Barkoder Class, the full list of API functions follows:
Set camera frames callback if you want to receive the frames/images only without decoding them and do your own work with the frames
@objc public func setPreviewFramesDelegate(_ delegate:
BarkoderPreviewFramesDelegate?)
Set zoom factor for the camera preview
If a preview session is already active this zoom factor will be set only for this session, therefore initial zoom will be set
every next preview session is started with this zoom factor
@objc public func setZoomFactor(_ zoomFactor: Float)
Check if current mobile device has flash available
@objc public func isFlashAvailable(_ completion: @escaping(_ flashAvailable: Bool) ->
Void)
Turn flash ON/OFF
If preview session is already active this state will be set only for active session otherwise the initial flash state is set.
Every next preview session will be started with this state
@objc public func setFlash(_ enabled: Bool)
Start the camera preview only, without decoding
@objc public func startCamera()
Stop the camera preview session and decoding if active
@objc func stopCamera()
Start the camera preview (if is not already running) and the scanning process
@objc public func startScanning(_ resultDelegate: BarkoderResultDelegate) throws
Stop the scanning process and the camera preview
@objc public func stopScanning()
Pause only the scanning process. Camera preview is still running
@objc public func pauseScanning()
Get the decoder config object. With this object you can enable/disable decoders (barcode types) or configure each one of them
@objc public var decoderConfig: Config? = nil
Location line color as UIColor
@objc public var locationLineColor: UIColor
Get the location line width as float
Default value is 2.0
@objc public var locationLineWidth: Float
Region of interest line color as UIColor
@objc public var roiLineColor: UIColor
Region of interest line width as float
Default value is 2.0
@objc public var roiLineWidth: Float
Region of interest background color as UIColor
@objc public var roiOverlayBackgroundColor: UIColor
Check if camera preview session will be closed when barcode is scanned
Default value is true
@objc public var closeSessionOnResultEnabled: Bool
Check if the image result is enabled
Image result is received in BarkoderResultDelegate as UIImage
Default value is false
@objc public var imageResultEnabled: Bool
Check if barcode location in the image result is enabled
If enabled, barcode in the result image will be marked
Default value is false
@objc public var locationInImageResultEnabled: Bool
Check if barcode location in preview is enabled
Default value is true
@objc public var locationInPreviewEnabled: Bool
Set active region of interest
@objc open func setRegionOfInterest(_ value: CGRect) throws
Get active region of interest
Default value is 'CGRect(x: 3, y: 30, width: 94, height: 40)'
@objc open func getRegionOfInterest() -> CGRect
Set maximum threads that will be used for the decoding process
@objc func setThreadsLimit(_ value: Int) throws
Get maximum threads that are used for the decoding process
@objc open func getThreadsLimit() -> Int
Check if the camera preview can be zoomed with pinch
Default value is false
@objc public var pinchToZoomEnabled: Bool
Check if ROI is visible on the preview screen
Default value is true
@objc public var regionOfInterestVisible: Bool
Get the active resolution. It can be Normal(HD), or HIGH(Full HD)
Default value is BarkoderView.BarkoderResolution.normal
@objc public var barkoderResolution: BarkoderView.BarkoderResolution
Check if a device will beep on successful scan
Default value is true
@objc public var beepOnSuccessEnabled: Bool
Check if a device will vibrate on successful scan
Default value is true
@objc public var vibrateOnSuccessEnabled: Bool
Getting barcode thumbnail on result
@objc public var barcodeThumbnailOnResult: Bool
Getting threshold between duplicates scans
@objc public var thresholdBetweenDuplicatesScans: Int
@objc open func setMulticodeCachingEnabled(_ boolean: Bool)
@objc open func getMulticodeCachingEnabled() -> Bool
@objc open func setMulticodeCachingDuration(_ value: Int)
@objc open func getMulticodeCachingDuration() -> Int
@objc public static func GetVersion() -> String
Scan barcode from a bitmap image
Parameters:
@objc public static func scanImage(_ image: UIImage, bkdConfig: BarkoderConfig,resultDelegate: BarkoderResultDelegate)
Apply config params from a pre-defined template
Parameters:
@objc public static func applyConfigSettingsFromTemplate(_ config: BarkoderConfig,
template: BarkoderConfigTemplate, finished: @escaping (BarkoderConfig) -> Void)
Retrieve config properties from the URL and apply them in the config that is sent as an input param
Parameters:
@objc public static func applyConfigSettingsFromURL(_ config: BarkoderConfig, url: URL,
finished: @escaping (BarkoderConfig?, Error?) -> Void)
Retrieve config properties from the URL and apply them in the config that is sent as an input param
Parameters:
@objc public static func applyConfigSettingsFromFile(_ config: BarkoderConfig, url: String,
finished: @escaping (BarkoderConfig?, Error?) -> Void)
Parameters:
@objc public static func applyConfigSettingsFromJson(_ config: BarkoderSDK.BarkoderConfig, jsonData: Data, finished: @escaping (BarkoderSDK.BarkoderConfig?, (Error)?) -> Void)
Export config that is send as input param to JSON string
@objc public static func configToJSON(_ barkoderConfig: BarkoderConfig) -> String?
Find out more: