Skip to main content

iOS SDK

Build native iOS and iPadOS applications using the Aila SDK. The SDK is provided as dynamically linked xcframeworks compatible with iOS/iPadOS 16.0 or greater.

Installation

The Aila SDK is provided as 2 dynamically linked xcframeworks:

  • Aila.xcframework
  • AilaDecoder.xcframework

Integration Steps

  1. Add both xcframeworks to your Xcode project
  2. In your target's General tab, add both frameworks to Frameworks, Libraries, and Embedded Content
  3. Set both xcframeworks to Embed & Sign

The frameworks expect to be placed in Frameworks/. This is done automatically if imported in Xcode and added to the "Embed Frameworks" build phase.

Quick Start

Import the framework and initialize the SDK:

#import <Aila/Aila.h>

// Initialize the SDK
Aila_Init();

// Read license
Aila_ReadLicense(@"your-license-key-here");

// Configure SDK
AilaConfiguration *config = [[AilaConfiguration alloc] init];
config.beepMode = AilaBeepModeOn;
config.multiScanMode = AilaMultiScanModeOff;

Aila_SetConfiguration(config);
tip

Initialize the SDK early in your app lifecycle, typically in application(_:didFinishLaunchingWithOptions:).

Basic Usage

Here's a complete example with scanning functionality:

#import <Aila/Aila.h>

@interface ViewController ()
@end

@implementation ViewController

- (void)viewDidLoad {
[super viewDidLoad];

// Initialize SDK
Aila_Init();
Aila_ReadLicense(@"your-license-key-here");

// Configure scanning
AilaConfiguration *config = [[AilaConfiguration alloc] init];
config.beepMode = AilaBeepModeOn;

// Set up scan callback
config.scanCallback = ^(NSArray<AilaScanObject *> *results) {
for (AilaScanObject *scan in results) {
NSLog(@"Scan Type: %@", [scan typeDescription]);
NSLog(@"Scanned Data: %@", scan.data);
}
};

Aila_SetConfiguration(config);
}

- (void)startScanning {
Aila_Start();
}

- (void)stopScanning {
Aila_Stop();
}

@end

MRZ Scanning Example

To enable MRZ (Machine Readable Zone) scanning with detection feedback:

// Configure for MRZ scanning
AilaConfiguration *config = [[AilaConfiguration alloc] init];
config.mrzMode = AilaMRZModeOn;
config.mrzDetectionMode = AilaMRZDetectionModeOn;

// Handle scan callback
config.scanCallback = ^(NSArray<AilaScanObject *> *results) {
for (AilaScanObject *scan in results) {
if ([scan isKindOfClass:[AilaMRZScanObject class]]) {
AilaMRZScanObject *mrzScan = (AilaMRZScanObject *)scan;
NSLog(@"MRZ Data: %@", mrzScan.data);
NSLog(@"Raw MRZ: %@", mrzScan.rawData);
}
}
};

Aila_SetConfiguration(config);

// Listen for early MRZ detection
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleMRZDetected:)
name:AilaMRZDetectedNotification
object:nil];

Next Steps