Skip to content

iOS Libraries Setup

Overview

This guide covers integrating the Maverick AI SDK into a native iOS project (Swift + UIKit or SwiftUI).

Building a cross-platform app?

For new projects, consider Compose Multiplatform (KMP) - the recommended path that lets you share UI and logic across Android and iOS.

The SDK is distributed via Swift Package Manager (SPM):

Name SPM Product Description
Maverick AI SDK MaverickAI Core SDK

Swift Package Manager (SPM) Setup

1) Add package in Xcode

  1. Open your Xcode project.
  2. Go to FileAdd Package Dependencies....
  3. Enter the Maverick AI SPM package URL:

    https://github.com/everysight-maverick-AI/mav-ai-ios-spm.git

  4. Choose a dependency rule (branch: main for latest, or pin a release tag in production).

  5. Add product MaverickAI to your iOS target.

In target settings → GeneralFrameworks, Libraries, and Embedded Content:

  • Ensure product MaverickAI is linked for every target that uses SDK APIs.

3) Import the SDK module

In Swift source files, import the SDK with:

import MaverickAI

4) Add compose resources build phase (one-time setup, required)

  1. In Xcode, select your app target → Build Phases.
  2. Click +New Run Script Phase.
  3. Rename it to Copy Maverick AI Compose Resources.
  4. Drag it after the "Copy Bundle Resources" phase.
  5. Paste the following script:

    for FW in "${TARGET_BUILD_DIR}/${PRODUCT_NAME}.app/Frameworks/"*.framework; do
        if [ -d "$FW/compose-resources" ]; then
            rsync -av "$FW/compose-resources" \
                "${TARGET_BUILD_DIR}/${PRODUCT_NAME}.app/"
        fi
    done
    
  6. Uncheck "Based on dependency analysis" in the Run Script's settings (or set alwaysOutOfDate = 1; in pbxproj) to silence Xcode's no-outputs warning.

Required

Without this Run Script, calling Evs.shared.showUI(...) will throw MissingResourceException ... compose-resources/... at runtime. One-time setup; never changes between SDK versions.

5) Validate platform deployment targets

Make sure your app targets meet the minimum iOS version (iOS 16) required by the package release you selected.

SDK Initialization

ViewController.swift
import MaverickAI

Evs.shared.doInit()

Resources

Drop your files into the iOS app bundle:

Kind Where
API key (sdk.key / app.key) App bundle root: drop into the iOS target → "Copy Bundle Resources"
Glasses content (M2Image, M2Font, AR .obj/.png) App bundle: drop into the target → "Copy Bundle Resources". Folder references (blue folders) keep sub-paths so <App>.app/files/images/foo.png works
Phone-UI assets Standard iOS - Assets.xcassets, UIImage(named:), NSLocalizedString

See the Resources guide for the equivalent rules on Android and KMP.

Common integration checks

  • App permissions and entitlements are configured (Bluetooth, camera, microphone) - see Starting Application Development.
  • Your iOS target includes the MaverickAI framework product.
  • The "Copy Maverick AI Compose Resources" build phase from step 4 is in place (otherwise the SDK's M2 phone-UI Kit will throw MissingResourceException ... compose-resources/... when shown).
  • Release build runs end-to-end (not only Debug).

See Also