Swiftpack.co - imgly/IMGLYEngine-SP as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by imgly.
imgly/IMGLYEngine-SP 1.19.0-rc.0
Fully customizable, simple-to-use design editor
⭐️ 7
🕓 2 days ago
iOS macOS
.package(url: "https://github.com/imgly/IMGLYEngine-SP.git", from: "1.19.0-rc.0")

Hero image showing the configuration abilities of IMGLYEngine

IMGLY Creative Engine

This package contains the Swift version of the IMG.LY Creative Engine, the core of CE.SDK. The Creative Engine enables you to build any design editing UI, automation and creative workflow in Swift. It offers performant and robust graphics processing capabilities combining the best of layout, typography and image processing with advanced workflows centered around templating and adaptation.

The Creative Engine seamlessly integrates into any iOS app whether you are building a photo editor, template-based design tool or scalable automation of content creation for your app.

Visit our documentation for more tutorials on how to integrate and customize the engine for your specific use case.

License

The CreativeEditor SDK is a commercial product. To use it as such and get access to its white-label version - without the watermark in the export - you need to unlock the SDK with a license file. You can purchase a license at https://img.ly/pricing.

Integration

SwiftUI

import IMGLYEngine
import SwiftUI

struct IntegrateWithSwiftUI: View {
  @State private var engine: Engine?

  var body: some View {
    Group {
      if let engine {
        ContentView(engine: engine)
      } else {
        ProgressView()
      }
    }
    .onAppear {
      Task {
        engine = try await Engine(license: Secrets.licenseKey, userID: "guides-user")
      }
    }
  }
}

struct ContentView: View {
  @StateObject private var engine: Engine

  init(engine: Engine) {
    _engine = .init(wrappedValue: engine)
  }

  var body: some View {
    ZStack {
      Canvas(engine: engine)
      Button("Use the engine") {
        // do something with the instance of Engine
      }
    }
  }
}

UIKit

import IMGLYEngine
import MetalKit
import UIKit

class IntegrateWithUIKit: UIViewController {
  private var engine: Engine?
  private lazy var canvas = MTKView(frame: .zero, device: MTLCreateSystemDefaultDevice())
  private lazy var spinner = UIActivityIndicatorView()
  private lazy var button = UIButton(type: .system, primaryAction: UIAction(title: "Use the engine", handler: { [unowned self] _ in
      guard let engine else { return }
      // do something with the instance of Engine
  }

  override func viewDidLoad() {
    super.viewDidLoad()

    view.addSubview(canvas)
    view.addSubview(spinner)
    view.addSubview(button)
    // setup constraints

    spinner.startAnimating()
    spinner.hidesWhenStopped = true
    button.isHidden = true
  }

  // pass lifecycle events
  override func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(animated)
     Task {
        engine = try await Engine(context: .metalView(view: canvas), license: Secrets.licenseKey, userID: "guides-user")
        engine?.onAppear()
        spinner.stopAnimating()
        button.isHidden = false
      }
  }

  override func viewWillDisappear(_ animated: Bool) {
    super.viewWillDisappear(animated)
    engine?.onDisappear()
  }
}

Documentation

The full documentation of IMGLYEngine can be found at here. There you will learn what configuration options are available and find a list and description of all API methods.

License

The IMGLYEngine is a commercial product. To use it as such and get access to its white label version - without the watermark in the export - you need to unlock the SDK with a license file. You can purchase a license at https://img.ly/pricing.

Changelog

To keep up-to-date with the latest changes, visit CHANGELOG.

GitHub

link
Stars: 7
Last commit: 2 days ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics