Enable EasyAR features in iOS applications
This chapter describes how to configure the EasyAR iOS project in Xcode without using 3D engines such as Unity.
Preparation
Before you start, you need to prepare:
Xcode 16 or later
Obtain an EasyAR license
Choose EasyAR Sense release version and download
Enable EasyAR with Objective-C
Add frameworks
Add
easyar.xcframeworkinFrameworks, Libraries, and Embedded Content.
Disable bitcode
EasyAR does not use bitcode nor provide bitcode compatibility, so bitcode needs to be disabled in the configuration.

Initialize EasyAR
Use the
initialize:method ofeasyar_Engineto initialize EasyAR. You can add the initialization code as follows:[easyar_Engine initialize:key];Privacy configuration
Since AR requires the use of the camera, the privacy configuration needs to add
Privacy - Camera Usage Description.
If you want to use the screen recording feature, the privacy configuration needs to add
Privacy - Microphone Usage Description.
Enable EasyAR through the Swift API
The EasyAR Sense Swift API is provided in source code form, offering the best compatibility (Apple has provided ABI compatibility since Swift 5).
To use the EasyAR Sense Swift API, you first need to create a framework project and then embed the framework target into your project.
Create easyarswift framework project
Create a new Cocoa Touch Framework project and name it
EasyARSwiftYou can choose to embed the EasyARSwift project within your app project or create a separate project.

Import EasyAR Swift code into the EasyARSwift project

The auto-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 until swift files are imported, so ensure swift code is imported before modifying configuration.
Import
easyar.xcframeworkinto the EasyARSwift project
Disable Bitcode
EasyAR doesn’t use bitcode nor provide bitcode compatibility. Ensure bitcode is disabled in configurations.

Deployment Target
Adjust
deployment targetaccording to your app project, ensuring the EasyARSwift project’sdeployment targetis ≤ the app project’s.

Embed and use EasyARSwift framework
Embed EasyARSwift framework in the project


In Swift source code,
import EasyARSwift
For code writing methods, refer to the code in the HelloARSwift sample or API Reference.