This guide is split in three parts:
- The first part describes how to get the Barcode Scanner SDK and build the demo project that comes with it.
- The second part shows how you can integrate the SDK in your own app in 5 easy steps.
- The last part contains some troubleshooting tips.
1. Get SDK and build demo project
To download and build the barcode scanner demo project, perform the following four steps:
1.1 Download
Choose a plan (e.g., free “Community” plan) and download the Barcode Scanner SDK.
1.2 Open demo project in Xcode
Unpack the downloaded ZIP file and open the demo project (ScanditSDKDemo.xcodeproj) in Xcode.
1.3 Set app key
In the DemoViewController.mm file, locate the following macro definition and paste your personal app key between the quotation marks. Sign in to your account at http://account.scandit.com to look up your app key (see “App key” link).
#define kScanditSDKAppKey @""
1.4 Build and run
You can now build and run the demo project. If you are experiencing any problems, please see section on troubleshooting below.
2. Integrating the SDK in your own app
2.1 Get your SDK
Choose a plan and download the Barcode Scanner SDK.
2.2 Add the SDK to your project
The ZIP file you downloaded contains a folder named ScanditSDK. Copy this folder and add it to your Xcode project.
2.3 Add frameworks to your Xcode project
The Scandit SDK needs multiple frameworks that might not be part of your Xcode project yet. Add all the Frameworks that are listed in the following screenshot.

2.4 Check the C++ Standard Library used by Xcode
Go to your project’s target settings and search for the “C++ Standard Library” property. Make sure it is not set to “libc++”. Set it to “Compiler Default” or “libstdc++” instead.
2.5 Prepare class to receive scanning events
First of all, change the file extension of your class’ file from .m to .mm for Xcode to know that it links to C++ classes.
To receive events from the Scandit SDK you have to implement the ScanditSDKOverlayControllerDelegate protocol. To do this, you need to perform the following steps:
- Edit the header file of the class that should receive these events and import a new header:
#import "ScanditSDKOverlayController.h"
- Specify that your class adheres to the ScanditSDKOverlayControllerDelegate protocol. If your class is called DemoViewController and inherits from UIViewController, this looks something like this:
@interface DemoViewController : UIViewController <ScanditSDKOverlayControllerDelegate> { } - In the body of the class, add the following methods (as defined by the protocol):
- (void)scanditSDKOverlayController: (ScanditSDKOverlayController *)scanditSDKOverlayController didScanBarcode:(NSDictionary *)barcodeResult {} - (void)scanditSDKOverlayController: (ScanditSDKOverlayController *)scanditSDKOverlayController didCancelWithStatus:(NSDictionary *)status {} - (void)scanditSDKOverlayController: (ScanditSDKOverlayController *)scanditSDKOverlayController didManualSearch:(NSString *)input {} - Process the barcodeResult returned by the didScanBarcode method. The NSDictionary contains two key/value pairs:
Key Value "barcode" String containing the data read from the barcode/2d code. "symbology" The barcode symbology. Possible values are:
"EAN8", "EAN13", "UPC12", "UPCE", "EAN128", "CODE39", "ITF", "QR", "DATAMATRIX"
2.6 Add code to start the scanning process
The scanning process is started by instantiating the barcode picker (ScanditSDKBarcodePicker). The following code snippets show how to do this.
- Import the ScanditSDKBarcodePickerheader:
#import "ScanditSDKBarcodePicker.h"
- Instantiate the picker. Do not forget to replace ##AppKey## with your personal app key, which you can look up by signing in to your account at http://account.scandit.com (see “App key” link).
ScanditSDKBarcodePicker *picker = [[ScanditSDKBarcodePicker alloc] initWithAppKey:@"##AppKey##"]; - Specify the delegate that will receive the callback events. In this example, we assume that the delegate is the same class that also instantiated the picker:
picker.overlayController.delegate = self;
- Start the scanning process:
[picker startScanning];
- Show the scanner to the user. The easiest way to do so is by presenting it modally:
[self presentModalViewController:picker animated:YES]; [picker release];
For alternative ways of presenting the scanner (e.g., with a UINavigationController, a UITabViewController, as a subview or in landscape mode), please refer to the demo project.
3. Customizing the SDK
The Scandit SDK offers a number of customization features. Among others, the Scandit SDK offers options to:
- Customize the scan view within your app
- Disable barcode symbologies your app will not support
- Add additional locales
- Change the scan beep
For a detailed list of available API methods, see the header files included in the Scandit SDK folder.
4. Problems, crashes?
Please check the console output in Xcode. The Scandit SDK writes log messages to the console that can help you identify problems.
If you have problems with the demo project: Did you change the project settings as described above?
If your app crashes and you are using the Enterprise Trial SDK: Does your phone have access to the internet? Your app will terminate otherwise. Note that our other versions (Community, Enterprise Basic, Enterprise Premium) do not have this requirement and work without network access.
