In this example, we will show you how to make basic configurations for the mobile editor. The example is based on the Design Editor
, however, it is exactly the same for all the other solutions.
Configuration
All the basic configuration settings are part of the EngineSettings
which are required to initialize the editor.
DesignEditor(settings)
license
- the license to activate the Engine with.
license: secrets.licenseKey,
userID
- an optional unique ID tied to your application’s user. This helps us accurately calculate monthly active users (MAU). Especially useful when one person uses the app on multiple devices with a sign-in feature, ensuring they’re counted once. Providing this aids in better data accuracy. The default value isnil
.
userID: "<your unique user id>",
baseURL
- is used to initialize the engine’sbasePath
setting before the editor’sonCreate
callback is run. It is the foundational URL for constructing absolute paths from relative ones. This URL enables the loading of specific scenes or assets using their relative paths. The default value is pointing at the versioned IMG.LY CDNhttps://cdn.img.ly/packages/imgly/cesdk-engine/1.51.0/assets
but it should be changed in production environments.
baseURL: URL(string: "https://cdn.img.ly/packages/imgly/cesdk-engine/1.51.0/assets")!
Full Code
import IMGLYDesignEditorimport SwiftUI
struct BasicEditorSolution: View { let settings = EngineSettings( license: secrets.licenseKey, userID: "<your unique user id>", baseURL: URL(string: "https://cdn.img.ly/packages/imgly/cesdk-engine/1.51.0/assets")! )
var editor: some View { DesignEditor(settings) }
@State private var isPresented = false
var body: some View { Button("Use the Editor") { isPresented = true } .fullScreenCover(isPresented: $isPresented) { ModalEditor { editor } } }}
#Preview { BasicEditorSolution()}