Skip to main content

iOS Quickstarts

Each quickstart is a small SwiftUI app that does exactly one thing with the Aila SDK. They are meant to be read in a few minutes. They all live in one Xcode project, one app target each, so you can open the project, pick a scheme, and run.

The quickstarts​

QuickstartWhat it showsNeeds
Minimal BarcodeInitialize the SDK, pick symbologies, receive scans. No camera preview.Standard symbologies
Barcode with PreviewSame scanning with an AilaCaptureView camera preview in SwiftUI.Standard symbologies
Multi-ScanMulti-scan mode, duplicate filtering, and resetting the scan session.Standard symbologies
MRZ ScanningRead a passport or ID MRZ and parse the returned JSON.MRZ entitlement
MRZ with GuidesMRZ scanning with a camera preview and alignment guides.MRZ entitlement
MRZ DetectionReact to early MRZ detection, show the camera only when needed, dim kiosk LEDs.MRZ entitlement
Driver's License ParsingParse a US driver's license PDF417 into named fields.DL Parsing entitlement
ID TrayDetect an ID-1 card in the tray and capture an image.Interactive Kiosk with ID Tray
DiagnosticsHardware and SDK info plus a live, exportable SDK log console.Standard symbologies

Every quickstart runs on an iPhone or iPad with no Aila hardware. Standard symbologies are included in every license and covered by the 250-scan allowance described below. The MRZ and DL Parsing quickstarts still build and scan barcodes without their entitlement, but the feature they demonstrate needs it. ID Tray needs the kiosk accessory to do anything.

Download the source​

Download AilaQuickstarts.zipXcode project and Swift source.
The SDK frameworks are not in the zip

The download contains the Xcode project and Swift source only. Before you build, sign in to the Aila Developer Portal, download the iOS SDK, and copy Aila.xcframework and AilaDecoder.xcframework into the AilaQuickstarts folder next to AilaQuickstarts.xcodeproj. The project already references both frameworks at that location.

Set up and run​

  1. Unzip the download and add the two frameworks as described above.
  2. Open AilaQuickstarts.xcodeproj in Xcode 15 or later.
  3. Pick a quickstart from the scheme menu. Each one has a shared scheme.
  4. Select the app target, open Signing & Capabilities, and choose your team. The targets ship with no team set.
  5. Run on a physical device.

Licensing​

Either call Aila_ReadLicense with your license key provided by Aila, or use Cloud licensing.

To use cloud licensing point the app at a bundle ID your organization has registered:

  1. In Xcode, select the target and open Signing & Capabilities.
  2. Change Bundle Identifier from com.aila.quickstarts.<Name> to a bundle ID registered in your organization's configuration.
  3. If you need to add a new bundle ID, follow Editing bundle IDs in the Portal Documentation.

The SDK picks up the entitlements for that bundle ID on its own.

How each quickstart is laid out​

The folders all follow the same shape.

  • App.swift is the @main entry point and does nothing else.
  • View.swift is the SwiftUI view. It starts scanning in onAppear and stops in onDisappear.
  • ViewModel.swift holds every Aila SDK call. If you only read one file per quickstart, read this one.
  • AilaCaptureViewRepresentable.swift appears only where a camera preview is shown. It wraps the UIKit AilaCaptureView for SwiftUI.
  • Info.plist includes the NSCameraUsageDescription the SDK needs to open the camera.

Quickstarts-Bridging-Header.h is shared by every target and imports the Aila headers into Swift.

The code blocks on each quickstart page are pulled from the same files that are in the zip, so what you read here is what you download.

Where to go next​