Skip to content
Objective-C Objective-C++
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.

##SmartID Scan Library (v1.2.0)

SmartID Scan is a real-time video stream decoder, allowing to scan various type of content.

Depending on the version you ordered, you will be able to use it to decode any combination of the following codes :

  • 1D/2D barcodes (EAN8, EAN13, UPC, Code39, Code128, Datamatrix, databars, QRCodes, Aztec codes, ... )

  • Multiple OCR types :

    • OCR-B MRZ used on official papers (Swiss ID Cards, Swiss Passports, Swiss Driving license)
    • Swiss car plates
    • European Health Insurance Card
    • Swiss Inpayment Slips
  • Our decoder never stops growing, ask us about what's new in SmartID Scan !


This project has been tested with iOS 6+ and build with xCode 5.0+. If your project supports lower versions of the iOS framework, SmartID Scan may not work as expected and could show unexpected behaviour in your application.

This project is compatible with ARC and non-ARC projects

##Integration steps

This project is a demo iOS app to show how to integrate our decoding library in an iOS application. To make it work, just follow the few steps below :

  1. Add the library libSmartIDScan.a to your project (drag & drop to your project)

  2. Add the library headers : SmartScanner.h (library functions) and SmartIDScanTypes.h

  3. In your project properties, you will need to add the following framework :





  4. If you own a version of SmartID Scan providing OCR features, you will also need to download an iOS version of the 2.4.10 OpenCV Framework. You can download it and drag and drop it on your project.

  5. In your project target properties, in the "Build Settings" you will also need to set the "C++ Standard Library" to value "libc++".

  6. If you don't have any other part of your code using C++ apis, you will also need to drop into your project the "DummyCPPEnable" (.h and .mm) class to let XCode know that part of the project will contain c++ content.

  7. You'll need to add the following key description in your project (since iOS10) to allow your app to use the camera

    NSCameraUsageDescription Some description Text

This is all you need to be able to launch this project on a real device for testing purposes.

##Minimal implementation (See the example project for more details)

Interaction with the SmartID Scan library is done with a SmartScanner object. Instantiate it inside a view controller, when you want to use it :

##Start to scan //Create the SmartScanner object reference SmartScanner* sc;

//Init SmartScanner when needed, and set the delegate
sc = [[SmartScanner alloc] init];
sc.scDelegate = self;

//Set which type of code you want to decode
[sc setDecodingType:CODE_INSURANCE_CARDS];

//Retrieve the preview screen and display it on your view
UIView* preview = [sc previewViewWithViewSize:self.view.bounds];
[self.view addSubview:preview];

##Select the type of code you want to decode

You can use a combination of any type (defined in the SmartDecodingTypes enum) that is enabled in the version you have. At any point you can set another decoding type (Verify the enabled types of your SmartID Scan version by calling the version function).

Here are some examples :

  • 1D/2D barcodes (EAN8, EAN13, UPC, Code39, Code128, QRCodes, ... )

      [sc setDecodingType:CODE_QR_CODES | CODE_1D2D_BARCODES_ALL ];
  • OCR-B MRZ used on official papers (Swiss ID Cards, Swiss Passports, Swiss Driving license)

  • Swiss car plates

      [sc setDecodingType:CODE_PLATES ];
  • European Health Insurance Card

      [sc setDecodingType:CODE_INSURANCE_CARDS ];
  • Swiss Inpayment Slips

      [sc setDecodingType:CODE_OCR_B_BVR ];

##Retrieve the results by implementing the delegate protocol

-(void)SmartScannerFoundCode:(SmartScanner*)smartScan code:(NSString*) aCode ofType:(int)aType
    NSLog(@"SmartScanner result : %@  with type : %d", aCode, aType);

##Release the resources when you don't need to use the smartscanner anymore

[sc closeCameraStream];
sc = nil; //ARC
//[sc release] //not ARC


(1) The demonstration decoding libraries replace some characters in the result string with the character 'X'

You can’t perform that action at this time.