EyeQ Docs
Quickstart

iOS quickstart

Install the Video Mobile SDK and apply your first image correction on iOS.

This guide walks you through installing the Video Mobile SDK in your iOS project and applying your first image correction.

Prerequisites

Before you begin, ensure that you have:

  • Xcode 13.0 or later
  • iOS deployment target 11.0 or higher
  • Your API key and certificate from EyeQ

Install the SDK

Follow these steps to add the Video Mobile SDK to your iOS project.

  1. Add the framework, drag and drop DynamicFramework.xcframework into your Xcode project.

  2. Configure embedding, go to GeneralFrameworks, Libraries, and Embedded Content.

  3. Set the framework to Embed & Sign.

  4. Disable Bitcode, go to your target's Build Settings.

  5. Search for Enable Bitcode.

  6. Set it to No.

If your project uses GPUImage (v1), then you might experience namespace collisions since the SDK uses GPUImage internally. If conflicts occur, then consider isolating the SDK in a separate module.

Import the framework

Add the import statement to any file where you'll use the SDK:

import DynamicFramework

Initialize the SDK

Create an instance of PFCDynamic with your credentials:

let pfcDynamic = PFCDynamic(
    apiKey: "your_api_key",
    certificate: #"your_certificate"#
)

Use raw string literals (#"..."#) for certificates to avoid escaping special characters.

Verify initialization

Always check the initialization status before processing:

let status = pfcDynamic.checkStatus()

if status >= 0 {
    print("Initialization successful")
} else {
    print("Initialization failed with code: \(status)")
}

Status codes:

The checkStatus() method returns an integer code indicating whether the SDK initialized successfully. A return value of 0 means success, while negative values indicate other specific failures.

CodeDescription
0Success
-1Expired certificate
-2Wrong API key/certificate combination
-3Failed to initialize AI model
-4Failed to load model file from framework resources
-5Failed to create context

Process your first image

Here's a complete example that processes a UIImage:

import UIKit
import DynamicFramework

class ViewController: UIViewController {
    
    private var pfcDynamic: PFCDynamic!
    private let imageView = UIImageView()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        // Initialize the SDK
        pfcDynamic = PFCDynamic(
            apiKey: "your_api_key",
            certificate: #"your_certificate"#
        )
        
        // Verify initialization
        let status = pfcDynamic.checkStatus()
        guard status >= 0 else {
            print("SDK initialization failed: \(status)")
            return
        }
        
        // Set up the image view
        imageView.contentMode = .scaleAspectFit
        imageView.frame = view.bounds
        view.addSubview(imageView)
        
        // Process an image
        processImage()
    }
    
    func processImage() {
        guard let image = UIImage(named: "sample"),
              let cgImage = image.cgImage else {
            print("Failed to load image")
            return
        }
        
        do {
            let processedCgImage = try pfcDynamic.processImage(
                cgImage, 
                strength: 1.0
            )
            
            let processedImage = UIImage(
                cgImage: processedCgImage,
                scale: image.scale,
                orientation: image.imageOrientation
            )
            
            // Display the processed image
            imageView.image = processedImage
            
        } catch {
            print("Processing failed: \(error)")
        }
    }
}

Control correction strength

The strength parameter accepts values from 0.0 to 1.0:

// No correction
let minimal = try pfcDynamic.processImage(cgImage, strength: 0.0)

// Moderate correction
let moderate = try pfcDynamic.processImage(cgImage, strength: 0.5)

// Full correction
let full = try pfcDynamic.processImage(cgImage, strength: 1.0)

Configure video parameters

For video or camera feed processing, configure deflickering to ensure temporal consistency:

pfcDynamic.setParams(
    deflickerCurve: 0.08,   // Recommended: 0.08
    deflickerImage: 0.9,    // Recommended: 0.9
    skip: 1                  // Process every Nth frame (0 = all frames)
)

Reset deflickering when switching cameras or starting a new video:

pfcDynamic.resetDeflicker()

VIDEO-SDK Version 1.0.0.23 built from aa5eef97017e23db1d3051b079500606825ef474 on 5-6-2023.

Copyright © 2026 EyeQ Imaging Inc. All rights reserved.

On this page