iOS SDK

iOS Barcode Scanner SDK

Add barcode scanning to iPhone and iPad apps with the native barKoder iOS SDK. Integrate it with Swift or Objective-C to read 1D and 2D barcodes, scan continuously, decode damaged codes, and handle VIN, MRZ, PDF417 and DPM workflows.

iOS SDK

Native iOS Barcode Scanner SDK for Swift and Objective-C

The barKoder iOS SDK is a native barcode scanning framework that runs on the device. You add it to Xcode with Swift Package Manager, place a BarkoderView in a view controller and receive results through a delegate. Its public API is exposed to Objective-C as well as Swift. The same engine reads everyday retail barcodes and the hard cases: damaged labels, DPM marks, MRZ on passports and many barcodes at once.

What the iOS barcode SDK reads

  • 30+ 1D and 2D symbologies
  • QR Code and Data Matrix
  • Damaged and blurry barcodes
  • Deformed 1D barcodes
  • Batch MultiScan
  • Continuous scanning
  • VIN barcodes and VIN text
  • MRZ on passports and IDs
  • PDF417 on licenses and IDs
  • DPM Data Matrix
  • DotCode
  • Barcodes in photo library images

Test it on the barcodes your users actually scan. A trial license covers 25 devices for 30 days.

Start a free trial

Add an iOS barcode scanner to your app

  1. In Xcode, choose File > Add Packages and paste the barKoder SPM package URL.
  2. Add a camera usage description (NSCameraUsageDescription) to Info.plist.
  3. Import BarkoderSDK and add a BarkoderView to your view controller.
  4. Create a BarkoderConfig with your license key and enable the barcode types you need.
  5. Implement BarkoderResultDelegate and call startScanning.
Install with Swift Package Manager

Swift barcode scanner example

The minimum Swift code to scan a QR code, copied from the barKoder iOS installation guide. The current Swift package is version 1.7.2. You can also add Barkoder.xcframework and BarkoderSDK.xcframework to the project by hand, as the guide describes.

1. Swift Package Manager URL (File > Add Packages)
Text
          https://github.com/barKoderSDK/barkoder-sdk-ios-spm
        
2. Camera permission in Info.plist
XML
          <key>NSCameraUsageDescription</key>
          <string>BKD Scanner requires using camera</string>
        
3. Add BarkoderView to your view controller
Swift
          import UIKit
          import BarkoderSDK
          class ViewController: UIViewController {
          private var barkoderView: BarkoderView!
          override func viewDidLoad() {
          super.viewDidLoad()
          setupUI()
          setupConstraints()
          }
          private func setupUI() {
          barkoderView = BarkoderView()
          view.addSubview(barkoderView)
          }
          private func setupConstraints() {
          barkoderView.translatesAutoresizingMaskIntoConstraints = false
          barkoderView.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true
          barkoderView.topAnchor.constraint(equalTo: view.topAnchor).isActive = true
          barkoderView.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true
          barkoderView.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true
          }
          }
        
4. Create the config with your license key and enable QR
Swift
          private func createBarkoderConfig() {
          barkoderView.config = BarkoderConfig(licenseKey: "LICENSE_KEY") { licenseResult in print("Licensing SDK: \(licenseResult)") }
          // Enable QR barcode type
          guard let decoderConfig = barkoderView.config?.decoderConfig else { return }
          decoderConfig.qr.enabled = true
          }
        
5. Receive results with BarkoderResultDelegate
Swift
          extension ViewController: BarkoderResultDelegate {
          func scanningFinished(_ decoderResults: [DecoderResult], thumbnails: [UIImage]?, image: UIImage?) {
          if let textualData = decoderResults[0].textualData {
          print("Scanned result: ", textualData)
          }
          }
          }
        
6. Start scanning
Swift
          try? barkoderView.startScanning(self)
        

For a complete screen, see the iOS general example and the BKDSampleSwift project in the barKoder iOS SDK repository. Every class and property is listed in the iOS API reference.

An iOS barcode SDK for difficult codes

Each feature below has its own iOS example in the docs. Where the docs give a short setting, it is shown here.

Damaged, deformed and blurry barcodes

MatrixSight®, Segment Decoding, DeBlur

MatrixSight reads QR and Data Matrix codes that are missing their finder, timing or alignment patterns. Segment Decoding reads 1D barcodes that are crumpled, wrinkled or bent. DeBlur reads EAN and UPC barcodes affected by motion, lens or focus blur.

How MatrixSight reads damaged codes →

Batch MultiScan and continuous scanning

Many barcodes in one session

Keep the session open and read many barcodes of different types and sizes. Result caching and location reconstruction keep results stable while the camera moves.

Swift
              barkoderView.config?.closeSessionOnResultEnabled = false
              barkoderView.config?.setMulticodeCachingDuration(3000)
              barkoderView.config?.setMulticodeCachingEnabled(true)
              barkoderView.config?.decoderConfig?.duplicatesDelayMs = 0
              barkoderView.config?.decoderConfig?.maximumResultsCount = 200
            
Enable Batch MultiScan on iOS →

MRZ scanner for iOS

Passports, ID cards and visas

Read the Machine Readable Zone on the device in real time. Results can include the main, document, signature and picture images.

Swift
              decoderConfig.idDocument.enabled = true
            
Enable MRZ mode on iOS →

VIN scanning

Code 39, Code 128, QR Code and Data Matrix

VIN mode combines MatrixSight and Segment Decoding to read the barcodes that carry Vehicle Identification Numbers. Apply the VIN template in one call, or enable the four symbologies by hand. OCR support reads the printed VIN too.

Swift
              barkoderView.config?.decoderConfig?.code39.enabled = true
              barkoderView.config?.decoderConfig?.code128.enabled = true
              barkoderView.config?.decoderConfig?.datamatrix.enabled = true
              barkoderView.config?.decoderConfig?.qr.enabled = true
            
Enable VIN scanning on iOS →

PDF417, licenses and boarding passes

PDF417-LineSight® and built-in parsers

LineSight reads PDF417 barcodes that are missing their start and stop patterns, row indicators or whole data columns. The SA DL parser turns South African driving licenses, ID cards and vehicle license discs into fields. A BCBP parser reads boarding passes.

Enable the South African parsers on iOS →

Data Matrix and DPM on iPhone

Direct Part Marking

DPM mode reads Data Matrix codes engraved or etched onto parts. The docs recommend slow decoding, Full HD resolution and a region of interest.

Swift
              barkoderView.config?.decoderConfig?.datamatrix.enabled = true
              barkoderView.config?.decoderConfig?.datamatrix.dpmMode = 1
            
See the iOS DPM example →

Apple VisionKit, AVFoundation or a commercial iOS barcode scanner SDK

iOS has barcode scanning built in. AVFoundation, the Vision framework and VisionKit's DataScannerViewController are free and need no extra package. Scandit, Dynamsoft and barKoder are commercial SDKs. Here is how to decide.

Apple's frameworks fit when

  • You want no third-party dependency and no license cost
  • Your codes are clean QR codes or common retail barcodes
  • You only ship on Apple platforms
  • For DataScannerViewController: your users run iOS 16 or later on devices with an A12 Bionic chip or later

barKoder fits when

  • Labels are damaged, blurred, wrinkled or on curved surfaces
  • You read dense PDF417, DPM marks, MRZ or VIN
  • You read many barcodes in one session with Batch MultiScan
  • You need formats outside Apple's Vision list, such as DotCode, MaxiCode, Telepen, Code 11 or postal barcodes
  • You also ship an Android, web or cross-platform app and want the same engine everywhere
  • You want direct support from the team that builds the engine

Whatever you compare, run each option on the same samples and the oldest iPhones your users have, and count failed and duplicate reads as well as successful ones.

Requirements and documentation

What you need

  • iOS 15.0 or later
  • Swift or Objective-C
  • Xcode, with Swift Package Manager or the two xcframeworks added by hand
  • Building with Xcode 27: barKoder SDK version 1.7.2 or later
  • A camera usage description in Info.plist
  • A barKoder license key. Without one, the SDK still scans but marks results as unlicensed.

One scanning engine for iOS and every other platform

The engine in the iOS SDK is also available as a native Android SDK, a Web SDK and plugins for cross-platform frameworks, so you can reuse the same setup across your apps.

  • 7 native & desktop SDKs
  • 6 cross-platform integrations
  • One consistent scanning core

barKoder in iPhone and Android apps

Two teams that ship barKoder on iOS and Android and needed the same results on both.

Try barKoder on your phone or in your browser

Install the free barKoder demo app, or open the web demo, and scan your own barcodes before you integrate the SDK.

iPhone and iPad

barKoder demo app for iOS

Scan with your camera, or point it at the QR code to open the App Store.

Download on the App Store
QR code linking to the barKoder demo app on the App Store

Android phones and tablets

barKoder demo app for Android

Scan with your camera, or point it at the QR code to open Google Play.

Get it on Google Play
QR code linking to the barKoder demo app on Google Play

Any modern browser

barKoder web demo

Runs the Web SDK in your browser, on desktop or mobile, with nothing to install.

Open the web demo
QR code linking to the barKoder web demo

Test with known samples. Print or display the testing sheet and scan each 1D and 2D barcode with the demo app. The data sheet summarizes the SDK for your team.

iOS barcode scanner SDK questions

What is the best barcode scanning SDK for native iOS?

It depends on what you scan. For clean QR codes and retail barcodes, Apple's built-in frameworks may be enough. If your users scan damaged labels, dense PDF417, DPM marks, MRZ or VIN, or read many barcodes at once, test a commercial iOS barcode scanner SDK such as barKoder on your own samples with a free trial license.

Can I install the iOS SDK with Swift Package Manager?

Yes. In Xcode, choose File > Add Packages, paste https://github.com/barKoderSDK/barkoder-sdk-ios-spm and keep the default "Up to Next Major Version" rule. You can also add Barkoder.xcframework and BarkoderSDK.xcframework by hand. See installing barKoder via Swift Package Manager.

Does the SDK work with Swift and Objective-C?

Yes. The docs and sample app use Swift, and the SDK's public API is also exposed to Objective-C.

How is barKoder different from VisionKit's DataScannerViewController?

DataScannerViewController is free and built into iOS. It needs iOS 16 or later and a device with an A12 Bionic chip or later. barKoder runs on iOS 15 and later and uses its own engine, with MatrixSight, Segment Decoding, DeBlur and PDF417-LineSight for damaged codes, plus MRZ, VIN, DPM and Batch MultiScan modes and formats such as DotCode and MaxiCode. barKoder needs a commercial license; see pricing.

Which iOS versions are supported?

iOS 15.0 and later, as declared in the Swift package. If you build with Xcode 27, use barKoder SDK version 1.7.2 or later.

Can I scan MRZ and Data Matrix codes on an iPhone?

Yes. Enable idDocument to read the MRZ on passports and ID cards, as shown in how to enable MRZ mode on iOS. Data Matrix is a standard symbology, and DPM mode reads Data Matrix codes engraved on parts.

Does the iOS barcode scanner work offline?

Scanning runs locally on the device. The SDK goes online only for the license check, and each device must reach the licensing server at least once every 30 days.

Is there a free trial, and what happens without a license key?

Without a key the SDK still scans, but results are marked as unlicensed. A trial license covers 25 devices for 30 days. Use trial licenses in development and staging only, and never publish one to the App Store.

Add barcode scanning to your iOS app

Test barKoder on your own barcodes and iPhones with a free trial, or talk to an SDK expert about your project.