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.xcframeworkAilaDecoder.xcframework
Integration Steps
- Add both xcframeworks to your Xcode project
- In your target's General tab, add both frameworks to Frameworks, Libraries, and Embedded Content
- 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:
- Objective-C
- Swift
#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);
import Aila
// Initialize the SDK
Aila_Init()
// Read license
Aila_ReadLicense("your-license-key-here")
// Configure SDK
let config = AilaConfiguration()
config.beepMode = .on
config.multiScanMode = .off
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:
- Objective-C
- Swift
#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
import UIKit
import Aila
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Initialize SDK
Aila_Init()
Aila_ReadLicense("your-license-key-here")
// Configure scanning
let config = AilaConfiguration()
config.beepMode = .on
// Set up scan callback
config.scanCallback = { results in
for scan in results {
print("Scan Type: \(scan.typeDescription())")
print("Scanned Data: \(scan.data)")
}
}
Aila_SetConfiguration(config)
}
func startScanning() {
Aila_Start()
}
func stopScanning() {
Aila_Stop()
}
}
MRZ Scanning Example
To enable MRZ (Machine Readable Zone) scanning with detection feedback:
- Objective-C
- Swift
// 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];
// Configure for MRZ scanning
let config = AilaConfiguration()
config.mrzMode = .on
config.mrzDetectionMode = .on
// Handle scan callback
config.scanCallback = { results in
for scan in results {
if let mrzScan = scan as? AilaMRZScanObject {
print("MRZ Data: \(mrzScan.data)")
print("Raw MRZ: \(mrzScan.rawData)")
}
}
}
Aila_SetConfiguration(config)
// Listen for early MRZ detection
NotificationCenter.default.addObserver(
self,
selector: #selector(handleMRZDetected),
name: NSNotification.Name(AilaMRZDetectedNotification),
object: nil
)
Next Steps
- Requirements - Platform and permission requirements
- Supported Formats - Barcode types and MRZ support
- Constants - Configuration constants reference
- API Reference - Complete method documentation