Enable EasyAR in iOS apps
This chapter describes how to configure an EasyAR project for iOS in Xcode without using 3D engines like Unity.
Preparations
Before starting, you need to prepare:
- Xcode 16 or a newer version
- Obtain an EasyAR license key
- Choose an EasyAR Sense release version and download
Enable EasyAR using Objective-C
Add Frameworks
Add
easyar.xcframeworkunderFrameworks, Libraries, and Embedded Content.
Disable Bitcode
EasyAR does not use bitcode nor provide bitcode compatibility. Disable bitcode in the configuration.

Initialize EasyAR
Use the
initialize:method ofeasyar_Engineto initialize EasyAR. Add the initialization code as follows:[easyar_Engine initialize:key];Privacy configuration
Since AR requires camera access, add
Privacy - Camera Usage Descriptionto the privacy configuration.
If screen recording is needed, add
Privacy - Microphone Usage Descriptionto the privacy configuration.
Enable EasyAR via Swift API
EasyAR Sense Swift API is provided in source code form to ensure optimal compatibility (Apple provides ABI compatibility starting from Swift 5).
To use EasyAR Sense Swift API, first create a framework project, then embed the framework target into your project.
Create EasyARSwift framework project
Create a new project of type Cocoa Touch Framework and name it
EasyARSwiftYou can choose to embed the EasyARSwift project within your app project or create a standalone project.

Import EasyAR Swift code into the EasyARSwift project

The automatically generated EasyARSwift.h file by Xcode is unused and can be safely deleted.
Configure
Objective-C Bridging Headerin build settings
Note
This option won't appear in Xcode settings before importing swift files, so be sure to import Swift code first before modifying the configuration.
Import
easyar.xcframeworkinto the EasyARSwift project
Disable Bitcode
EasyAR does not use bitcode nor provide bitcode compatibility. Ensure bitcode is disabled in the configuration.

Deployment Target
Modify the
deployment targetaccording to your app project. Ensure thedeployment targetof the EasyARSwift project is less than or equal to that of the app project.
Embed and use EasyARSwift framework
Embed the EasyARSwift framework in your project

import EasyARSwiftin Swift source files
Refer to the code in the HelloARSwift sample or the API Reference for implementation.