Skip to main content

Quickstart

The iOS Document Reading SDK is available as a Swift Package Manager (SPM) dependency.

Installation

1. Add Package Dependency

In Xcode, go to File > Add Package Dependencies... and enter the package repository URL:

https://github.com/Mobaibio/mobai-ios-sdk

2. Select Package Products

Select the following products from the package:

  • MobaiDocument - The core document reading module

3. Configure Info.plist

Add the following key to your Info.plist to enable camera access:

<key>NSCameraUsageDescription</key>
<string>This app needs camera access to scan documents</string>

4. Import the Module

In your Swift files where you need document reading functionality:

import MobaiDocument
import AVFoundation

License Setup

The SDK requires a valid license file. Add your iengine.lic file to your app bundle:

  1. Drag the license file into your Xcode project
  2. Ensure it's added to your app target
  3. The license will be loaded from the bundle at runtime

Basic Usage

The document reading SDK provides a ready-to-use view controller that handles document capture and MRZ reading:

import MobaiDocument
import AVFoundation

// Load license
let license = try LicenseHelper.loadLicense()

// Configure capture options
let configuration = MBDocumentCaptureOptions(
isMrzReadingEnabled: true,
isDismissButtonEnabled: false
)

// Create and present the capture view controller
let captureViewController = MBDocumentAutoCaptureViewController(
license: license,
configuration: configuration
)
captureViewController.delegate = self
navigationController.pushViewController(captureViewController, animated: true)

For detailed implementation instructions, see the Implementation Guide.

Sample Code

For complete working examples, refer to the iOS SDK Samples repository on GitHub.