What's new?
In version 4.7 of the Scandit Barcode Scanner, new sets of classes have been introduced that replace the public API of previous versions. To distinguish them from the old API, the new classes and enums are all prefixed with SBS (acronym for Scandit Barcode Scanner).
When updating from a version prior to 4.7, you have to upgrade to the new SBSBarcodePicker API.
Updating from ScanditSDKBarcodePicker to SBSBarcodePicker
This section highlights the differences between the SBSBarcodePicker and ScanditSDKBarcodePicker API and shows how to upgrade existing code.
Scan Settings
The ScanditSDKBarcodePicker contained methods to configure the scanning behavior, e.g. hot spot, enables symbologies, scanning area etc. In the SBSBarcodePicker, these methods no longer exists. Instead the barcode scanner is now configured through a SBSScanSettings instance. The scan settings instance allows you to configure the enabled symbologies and other scanning-related options. The settings do not immediately take effect, but only after applying them to the barcode picker, either when the picker is constructed, or through applyScanSettings:completionHandler: (SBSBarcodePicker).
New Delegates
The ScanditSDKOverlayControllerDelegate has been replaced by two separate delegates: SBSScanDelegate and the SBSOverlayControllerDidCancelDelegate. The former is used for listening to barcode scan events, the latter when the cancel button is pressed on the toolbar. The SBSScanDelegate must be implemented by all applications to handle barcode scanned events.
The key differences between the ScanditSDKOverlayControllerDelegate::scanditSDKOverlayController:didScanBarcode: and barcodePicker:didScan: (SBSScanDelegate-p) callback are:
- the SBSScanDelegate method is invoked on a picker-internal queue. To perform any UI work, you must dispatch to the main UI thread.
- to access the recognized codes use SBSScanSession::newlyRecognizedCodes. It's guaranteed that there is at least one new code available when the SBSScanDelegate gets called.
The following code snippet shows a simple implementation of a SBSScanDelegate callback:
Other changes
- For the new API, the default length of barcodes has been lowered for all variable-length symbologies (Code39, Code93, Code128, Codabar, Interleaved 2 of 5, MSI-Plessey). To scan codes that are longer than the new defaults, you must explicitly enable scanning of longer codes. Take a look at the SBSSymbologySettings::activeSymbolCounts documentation for details on how to do that.
- The search bar functionality is no longer available when using the SBSBarcodePicker. Instead, you need to implement your own search bar. An example of how this can be done can be found on the Provide a manual input method for 4.7+ page.