How to Add an iOS Barcode Scanner SDK
| Developers

Barcode scanning is a challenge underestimated by many iOS developers, going well beyond updating camera permissions and extracting data from images.
Picture this: you’re deep into the development of your Native iOS app and it’s a rollercoaster ride of late nights and endless coding sprints. Your team is focused on the priority one features but you know that eventually, the app’s barcode scanner will be put to the test by real users in real-world situations. The fate of positive or negative feedback and the size of your future bug backlog hangs in the balance.
Not all iOS barcode scanner SDKs are created equal. Whether the company wants to move away from inflexible single-purpose scanners or is starting fresh, there are two major issues that always come back to haunt developers: a subpar user experience (UX) and sluggish scanner performance.
Your barcode scanner must blend into your app seamlessly, feeling like an indispensable part of the user experience rather than a cumbersome addition. It also needs to work within the constraints of the physical world of your users, whether it’s the chaotic velocity of a busy retail environment or the rough and tumble usage of ruggedized iPhones in warehouse operations.
This blog explains the key UX and performance principles to successfully integrate an iOS barcode scanning library into your Native iOS app. It also includes a step-by-step tutorial for the Scandit iOS Barcode Scanner SDK using the SparkScan pre-built UI component.

START BARCODE SCANNING ON iOS
Add enterprise-class iOS barcode scanning fast
The importance of UX in iOS barcode scanning
Integrating an iOS barcode scanner library is like trying to implement concurrency and multithreading in your app. You can get into trouble fast if you’re not careful or experienced enough, but it improves the UX dramatically once you know how to use the SDK to its advantage.
More than capturing images and events
UX can make or break any iOS application — getting the art and science of navigation, interaction, and feedback right is the difference between user success and frustration. While it may seem like open-source barcode scanning libraries — a popular choice among developers — are feasible, they present the significant challenge of having to develop your own user interface (UI).
Paid libraries, on the other hand, often include pre-built UI components that reduce your reliance on UX expertise and effort.
The following UX workflows are important to consider when deciding which iOS barcode scanner SDK is right for you.
Starting the scanning process
Imagine users navigating through complex menus or switching between the app and a different interface when scanning barcodes. This isn’t just inconvenient. The disconnected experience incurs a job performance and satisfaction hit that can impact operations.
Good UX requires a seamless transition into scanning mode from within the application. As shown in the following video, the Scandit SparkScan iOS barcode scanner API enables users to swipe or tap a collapsed floating button to activate the scanner. It then provides a large, semi-transparent button to capture barcodes.
Aiming the camera
Aiming a smartphone camera can be a difficult task in situations where the barcode is far away from the user, or when they must bend or lie down to scan packages in hard-to-reach placements. It’s also challenging when packages have multiple barcodes printed on them, as all will be in the camera’s field of view and the user needs to be able to aim at and select just one.
To help users scan effectively, features like on-screen guides, visual hints, or even augmented reality (AR) overlays help position the camera correctly.
Here are two examples of in-app features:
- A viewfinder to help users understand that scanning is active and better position the camera.
- Restricting the scan area to help users capture barcodes in cluttered areas and improve performance on low-end devices.
Implementing strong and clear feedback
Your app should provide immediate and clear feedback on the success or failure of a barcode scan. A delayed or confusing response can lead to user frustration, especially in loud environments or locations where it’s hard to see the iOS device’s screen.
Feedback mechanisms include visual and auditory cues such as these examples:
- Drawing a symbol, like a brush overlay, at the location of the detected barcode to confirm that the app scanned the intended item.
- Playing a sound and vibrating the device when the scanner performs a capture.
Differentiating between single scan and continuous scan
Allowing users to choose between single scans and continuous scanning modes helps tailor the user experience to situations with different numbers of items to scan or different barcode configurations.
SparkScan has two modes built into its iOS barcode scanner SDK:
- Single scan: The user triggers the scanner for every barcode, providing greater scanning precision.
- Continuous scan: The user triggers the scanner once and the app scans multiple barcodes without further interaction, reducing user fatigue.

TESTING THE SCANDIT iOS SDK IS EASY
Integrate with just a few lines of code or use our samples
Which barcode scanner is best for iOS?
A fulfillment center processing thousands of packages a day is likely not the best environment for an open-source iOS barcode scanner library that takes its time to capture barcodes. The scanning software’s performance is just as important as the application code you write around it.
Here are some considerations to think about when selecting your scanner SDK.
1. Scan performance
In enterprise and commercial environments, you should take the following scan requirements into account:
- Speed: A barcode scanning library that captures and processes images fast means faster business operations.
- Accuracy: Relying on barcode scanning for inventory management, asset tracking, quality control, and similar operations requires a barcode scanning library that ensures the right items are selected, picked, and tracked.
- Field-of-view and distance: Scanners often have to deal with barcodes on objects of various sizes, shapes, and distances from the device.
- Start-up time: Your barcode scanner should support a “standby mode” that minimizes the delays between scans due to the camera starting up. With Scandit software, the transition between the camera’s standby mode and on can be up to 90% faster than between off and on.
- Handling tough barcodes: A barcode may be torn, partially obscured, wrapped in plastic, or reflect light that causes glare in the camera lens — your library should be able to handle all conditions.
- Handling multiple barcodes: Employees may need to scan multiple barcodes at the same time or in quick succession, such as a worker in a fulfillment center having to scan a product barcode and a location barcode fast to meet shipping times.
2. Low-light environments
In many settings, lighting conditions can vary widely. Barcode scanners should perform well in low-light or even no-light situations, such as stockrooms, back-of-store areas, or nighttime delivery routes.
3. Large and varied device fleets
Enterprises often have a diverse fleet of iOS-based employee devices, with different camera specifications and processor architectures (SparkScan’s system requirements are listed here).
Your barcode scanner library must be compatible with a wide range of iOS devices, ensuring employees have a consistent user experience and avoiding the need to retrain on every new device.
It must also be optimized for performance on your specific model so users don’t have to wait for scan results to complete — something not usually available with open-source packages.
We list key performance tests below to gauge how well your solution performs.
Scandit barcode scanning software is built on C/C++ to ensure core features are loaded efficiently in the background and consume minimal system resources.
4. Support for different development frameworks
If you’re working with different development platforms, ensure your barcode scanner solution supports it.
Scandit barcode scanning is available for Native Android, JavaScript, Xamarin, React Native, Flutter, .NET, Capacitor, Cordova, and Titanium.
How do I create a barcode scanner for iOS?
Using SparkScan, part of the Scandit Data Capture SDK for iOS, you can add pre-built and intuitive barcode scanner capabilities to any iOS (or Android) smartphone app.
Designed with well-researched UX principles and optimized based on the feedback of thousands of customers across a range of environments, SparkScan requires only a few steps to integrate its features into your app.
Its key feature is a pre-built scanning interface that floats on top of any iOS app, reducing your development time and solving many common scanning pitfalls for you. The interface is customizable for different needs — for example, options to provide audio or haptic feedback, the choice of triggering scans using a phone’s physical button, and scanning in left-handed mode.
The following sections explain how you can implement a customizable iOS barcode scanning interface in just a few steps.
Get started with SparkScan
The fastest way to see if SparkScan is suitable for your needs is to run one of our iOS barcode scanning examples on GitHub on your development device.
The prerequisites for the following steps are:
- The latest stable version of Xcode.
- An iOS project with a minimum iOS deployment target of 13.0 or higher.
- A valid Scandit Data Capture SDK license key. You can sign up for a free test account at ssl.scandit.com.
1. Add the SparkScan SDK to your project
Before setting up SparkScan, you need to obtain a valid Scandit Data Capture SDK license key:
If you already have a paid subscription, reach out to support@scandit.com if you need a new license key.
The simplest way to integrate the Scandit Data Capture SDK is to use CocoaPods. Alternatively, you can use Carthage, or manually add the dynamic framework to your project by following the steps in this guide.
To add the frameworks via CocoaPods, add the desired frameworks in your Podfile. For instance, to add ScanditBarcodeCapture API add
pod 'ScanditBarcodeCapture', '~> |shortversion|'
This will also download ScanditCaptureCore API, since ScanditBarcodeCapture API depends on it.
If you want to install a specific version, you can do so by specifying the version explicitly:
pod 'ScanditBarcodeCapture', '|version|'
A specific version is necessary when you want to install a beta version.
To add the frameworks via Carthage, add them to your Cartfile. For instance, to add ScanditBarcodeCapture API add:
binary "https://ssl.scandit.com/sdk/download/carthage/ScanditBarcodeCapture.json"
You must add ScanditCaptureCore API, since ScanditBarcodeCapture API depends on it.
binary "https://ssl.scandit.com/sdk/download/carthage/ScanditCaptureCore.json"
If you want to install a specific version, you can specify the version explicitly:
binary "https://ssl.scandit.com/sdk/download/carthage/ScanditBarcodeCapture.json" == |version|
2. Create the Data Capture Context instance
The first step to add barcode scanner capabilities to your application is to create a new Data Capture Context. The context expects a valid Scandit Data Capture SDK license key during construction.
self.context = DataCaptureContext(licenseKey: "-- ENTER YOUR SCANDIT LICENSE KEY HERE --")
3. Configure the SparkScan mode
The SparkScan Mode is configured through SparkScanSettings, allowing you to register one or more listeners that are informed whenever a new barcode is scanned.
For this blog, we set up SparkScan for scanning EAN13 barcodes. Change this to the symbologies for your use case (for example, Code 128, UPC).
let settings = SparkScanSettings() settings.set(symbology: .ean13UPCA, enabled: true) sparkScan.apply(settings, completionHandler: nil)
Next, create a SparkScan instance with the settings initialized in the previous step:
let sparkScan = SparkScan(settings: settings)
4. Setup the SparkScan View
The SparkScan built-in user interface includes the camera preview and scanning UI elements. These guide the user through the scanning process.
The SparkScanView appearance can be customized through SparkScanViewSettings.
let viewSettings = SparkScanViewSettings() // setup the desired appearance settings by updating the fields in the object above
By adding a SparkScanView, the scanning interface (camera preview and scanning UI elements) is added automatically to your application.
To add a SparkScan View to your view hierarchy, construct a new SparkScan view. The SparkScan view is automatically added to the provided parentView:
let sparkScanView = SparkScanView(parentView: view, context: context, sparkScan: sparkScan, settings: viewSettings)
Additionally, make sure to call SDCSparkScanView.prepareScanning and SDCSparkScanView.stopScanning in your UIViewController’s viewWillAppear and viewWillDisappear callbacks, to make sure that the start-up time is optimal and scanning is stopped when the application goes into the background.
override func viewWillAppear(animated: Bool) { super.viewWillAppear(animated) sparkScanView.prepareScanning() } override func viewWillDisappear(animated: Bool) { super.viewWillDisappear(animated) sparkScanView.stopScanning() }
5. Register the listener to be informed when a new barcode is scanned
To keep track of the scanned barcodes, implement the SDCSparkScanListener protocol and register the listener to the SparkScan mode.
// Register self as a listener to monitor the SparkScan session. sparkScan.addListener(self)
SDCSparkScanListener.sparkScan:didScanInSession:frameData: is called when a new barcode is scanned. This result can be retrieved from the first object in the provided barcodes list: SDCSparkScanSession.newlyRecognizedBarcodes. This list only contains one barcode entry.
Additionally, when a barcode is scanned, it is possible to emit a sound and visual feedback using SDCSparkScanView.emitFeedback as follows:
extension ViewController: SparkScanListener { func sparkScan(_ sparkScan: SparkScan, didScanIn session: SparkScanSession, frameData: FrameData?) { // Gather the recognized barcode let barcode = session.newlyRecognizedBarcodes.first // This method is invoked from a recognition internal thread. // Dispatch to the main thread to update the internal barcode list. DispatchQueue.main.async { // Update the internal list and the UI with the barcode retrieved above self.latestBarcode = barcode // Emit sound and vibration feedback self.sparkScanView.emitFeedback(SparkScanViewSuccessFeedback()) // Handle the barcode } } }
How to test the performance of barcode scanning on iOS apps
The best way to test a potential iOS barcode scanning SDK is to try it out in the real world. Whether you installed SparkScan or another barcode scanning library, here are several performance testing questions to ask yourself:
- Is there clear guidance, feedback, and helpful hints to foster a smooth workflow rather than a confused, error-prone activity?
- Can you scan barcodes in different orientations, such as upside down and sideways? Flip the phone upside down to see how the scanner performs.
- Can you scan barcodes with reflections and glare?
- Can you scan barcodes at a distance? Are you able to zoom in if needed?
- Do you receive scanning feedback in loud environments and while wearing headphones?
You can also use our barcodes sample sheet for quick evaluation, and find out more about how to measure barcode scanning performance in our in-depth best practice guide.
Your iOS barcode scanner SDK is more than just a technical choice
When you prioritize UX by integrating an iOS barcode scanner that simplifies usage, minimizes errors, and scales to growing business demands, you pave the way for increased adoption and productivity. Your chosen barcode scanning solution is the bridge between the app’s success and its potential for positive business transformation.
Next: Dive deeper into how to make a barcode scanning app performant →