Skip to main content

Getting started | iOS Barcode Scanner

The Scanbot Barcode Scanner SDK is delivered as an embedded framework, containing all iOS supported 32 and 64 bit simulator and device architectures, bitcode and crash symbols. It can be used with Objective-C as well as with Swift.

Please find the Scanbot Barcode Scanner SDK downloads below.

Standard framework for iOS: Download

XCFramework for iOS: Download

Note: The SDK also contains a little script that prepares the framework, and your application when archiving for App Store submission. It strips the unnecessary architectures from the binary framework, code signs the framework and adds the crash symbols (dSYM) file to your app's archive (Embeddable framework only!).

Installation using CocoaPods#

CocoaPods is a dependency manager for Swift and Objective-C projects for macOS as well as for iOS. It integrates deeply into your Xcode project and manages the third-party components in your application.

  1. If not already done, install CocoaPods on your Mac
  2. Add pods to your Xcode project as described in this guide
  3. Modify your Podfile to include the ScanbotBarcodeScannerSDK pod as described here

Open your Podfile in Xcode or with any text editing application and add the following line:

pod 'ScanbotBarcodeScannerSDK'

Your Podfile should now read as follows:

platform :ios, '11.0'
target 'My Awesome App' do  ...  use_frameworks!  pod 'ScanbotBarcodeScannerSDK'  ...end

Save the Podfile and run the

$ pod install --repo-update

command in your project folder using the macOS Terminal.

Open your application's Xcode workspace (not the project file). You should now be able to use Scanbot Barcode Scanner SDK in your project.

Installation as an embeddable framework#

Also, you can install the Scanbot Barcode Scanner SDK manually as an embeddable frameworkby applying the following steps:

  • Unzip the downloaded SDK archive file and copy ScanbotBarcodeScannerSDK folder into your project folder
  • Open your project in Xcode
  • Select your build target and add an embedded framework
  • Select 'Add Other...'
  • Locate and select ScanbotBarcodeScannerSDK.framework
  • Check 'Copy items if needed' and 'Create groups', then hit 'Finish'
  • Add a runscript build phase that runs the strip-script and set the dSYM file as the input file to this runscript phase

Step-by-step guide#

Step 1 Copy ScanbotBarcodeScannerSDK folder into your project folder

Step 2 Open your project in Xcode. Select your build target and add an embedded framework

Step 3 Select 'Add Other...'

Step 4 Locate and select ScanbotBarcodeScannerSDK.framework

Step 5 Add a runscript build phase

Step 6 Configure the runscript build phase

Script code:

bash "$BUILT_PRODUCTS_DIR/$FRAMEWORKS_FOLDER_PATH/ScanbotBarcodeScannerSDK.framework/strip-SBSDK-Framework.sh"

Script input file:

$(SRCROOT)/./ScanbotBarcodeScannerSDK/dSYMs/ScanbotBarcodeScannerSDK.framework.dSYM

Installation as an embeddable XCFramework (XCode 11+ only)#

Installing the Scanbot Barcode Scanner SDK embedded XCFramework is similar to using the framework, except for the strip script which is not needed with XCFrameworks. Check out our step-by-step guide.

  1. Copy ScanbotBarcodeScannerSDK folder into your app's project folder
  2. Open your app project in Xcode
  3. Select your app's build target and drag the XCFramework into it

Step-by-step XCFramework installation guide#

Step 1 Copy ScanbotBarcodeScannerSDK folder into your apps project folder Copy the downloaded ScanbotBarcodeScannerSDK folder into your app's project folder.

Step 2 Open your app project in Xcode Open your app project in Xcode.

Step 3 Drag the XCFramework into your project. Navigate into the ScanbotBarcodeScannerSDK folder and drag ScanbotBarcodeScannerSDK.xcframework into your project's 'Frameworks, Libraries and Embedded Content' section.

Import#

Now you should be able to import the framework's umbrella header in your source code and start using it.

import ScanbotBarcodeScannerSDK