Skip to main content
Platform
Language
Framework

Integrate the Mobile Camera

In this example, we will show you how to initialize the CreativeEditor SDK's mobile camera in your iOS app.

Explore a full code sample on GitHub.

Requirements#

The mobile camera requires iOS 16 and Swift 5.10 (Xcode 15.4) or later.

Using Swift Package Manager#

If you use Swift Package Manager to build your app and want to integrate the Creative Engine and UI modules using your regular workflows, add the IMGLYUI Swift Package as a dependency to your project.



This package provides multiple library products. Add the default IMGLYUI library to your app target to add all available UI modules included in this package to your app.

To keep your app size minimal, only add the library product that you need, e.g., only add the IMGLYCamera library if you need to import IMGLYCamera in your code. On the General page of your app target's Xcode project settings the Frameworks, Libraries, and Embedded Content section lists all used library products.

Usage#

This example shows the basic usage of the camera.

Import#

You can get started right away by importing the camera module into your own code.

In this integration example, the camera is presented as a modal view after tapping a button.

Initialization#

The camera is initialized with EngineSettings. You need to provide the license key that you received from IMG.LY. Optionally, you can provide a unique ID tied to your application's user. This helps us accurately calculate monthly active users (MAU) and it is especially useful when one person uses the app on multiple devices with a sign-in feature, ensuring they're counted once.

Result#

The Camera’s onDismiss closure returns a Result<CameraResult, CameraError>. If the user has recorded videos, the .success(_) case contains the CameraResult.

Environment#

The camera is best opened in a fullScreenCover.