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
- Open your Xcode project.
- Go to
File→Add Package Dependencies.... -
Enter the Maverick AI SPM package URL:
https://github.com/everysight-maverick-AI/mav-ai-ios-spm.git -
Choose a dependency rule (
branch: mainfor latest, or pin a release tag in production). - Add product
MaverickAIto your iOS target.
2) Link products to targets
In target settings → General → Frameworks, Libraries, and Embedded Content:
- Ensure product
MaverickAIis linked for every target that uses SDK APIs.
3) Import the SDK module
In Swift source files, import the SDK with:
4) Add compose resources build phase (one-time setup, required)
- In Xcode, select your app target → Build Phases.
- Click + → New Run Script Phase.
- Rename it to Copy Maverick AI Compose Resources.
- Drag it after the "Copy Bundle Resources" phase.
-
Paste the following script:
-
Uncheck "Based on dependency analysis" in the Run Script's settings (or set
alwaysOutOfDate = 1;inpbxproj) 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
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
MaverickAIframework 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
- Android Setup - Native Android project setup
- KMP Setup - Compose Multiplatform project setup
- API Keys - Configure SDK authentication