Deprecation warning
Please note that this is outdated documentation for an older release of the Scandit Barcode Scanner SDK.
We are deprecating the 5.x API on all platforms (except Linux). Release 5.19 in April 2021 will be our final. Applications running 5.x will continue to work, and we will continue to release critical bug fixes and security patches only, for one year. We encourage you to migrate to 6.x and take advantage of our latest / advanced features and improved performance.
You'll find the updated documentation at: Data Capture SDK Documentation for iOS
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 two options:
- continue to use the ScanditSDKBarcodePicker and ScanditSDKOverlayController classes. Improvements to the barcode recognition engine (performance, recognition rates) will also be available when using the ScanditSDKBarcodePicker. However, new features that require additions to the API will only be added to the SBSBarcodePicker. Thus if you need any of these new features, you will have to update to use the new classes. When you continue to use the ScanditSDKBarcodePicker you will only have to update the imports statement to use the headers contained in the ScanditBarcodeScanner framework. For example, you need to change to
- upgrade to the new SBSBarcodePicker API (see below).
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 Providing a manual input method for 4.7+ page.