Image Editor

TruvideoSdkImageEditorPreset

This class is part of the Truvideo SDK and is used to configure the image editor with specific settings before presenting it to the user.

There is 2 ways to configure this class:

Method 1:

  • imageURL: A URL pointing to the input image that will be edited.

  • outputURL: A URL where the edited image will be saved.

let configuration = TruvideoSdkImageEditorPreset(
    imageURL: imageUrl,   // URL of the image to be edited
    outputURL: outputUrl   // URL where the edited image will be saved
)

Method 2:

  • inputImage: image object

  • outputURL: A URL where the edited image will be saved.

let configuration2 = TruvideoSdkImageEditorPreset(
     image: inputImage,  // UIImage to be edited
     outputURL: outputUrl      // URL where the edited image will be saved
)

presentTruvideoSdkImageEditorView(preset:onComplete:)

This method is used to present the Truvideo image editor with a given preset configuration.

Parameters:

  • preset: An instance of TruvideoSdkImageEditorPreset containing the configuration for the editor.

  • onComplete: A closure that is called when the image editor finishes. It returns a result object that contains:

    • editedImage: The edited UIImage. If editing fails, a default empty UIImage is returned.

    • editedImageURL: The URL where the edited image is saved. This property is available on iOS 16.0 and later.

Example Usage :

Last updated

Was this helpful?