Skip to main content

Setup

This section explains how to integrate the EdgeOCR SDK into your project.

Prerequisites​

  • Xcode 16 - Swift 5.9 or later
  • A physical iOS device

1. Adding the SDK​

  1. Place the SDK zip file in the root directory of your project and extract it.

    Extracted SDK zip

  2. Open the Package Dependencies tab in Xcode (Project > Package Dependencies).

    Package Dependencies tab

  3. Click +, select the extracted SDK folder, and click Add Package.

    Selecting the SDK folder

  4. Click Add Package in the Package Products confirmation dialog.

    Adding Package Products

note

The SDK version and the version expected by the sample app must match.

2. Adding Model Files​

Add the OCR model files used by the SDK to your project.

  1. Extract the downloaded model file zip and add it to your project in Xcode via Add Files to [Project Name].

  2. Set the modelPath in MainView.swift to match the name of the model directory you added.

    let modelPath = "models"  // Name of the added model directory

    Internally, the SDK resolves the model directory using Bundle.main.path(forResource: modelPath, ofType: "").

3. Build Configuration (Android Only)​

Verify the following settings in app/build.gradle.

android {
compileSdk 36

defaultConfig {
minSdk 26
targetSdk 36
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
}

Once configured, run a build in Android Studio and verify that there are no errors.