Protocol

PHContentEditingController

A protocol your custom view controller class implements to provide a user interface for your Photos extension.

Declaration

protocol PHContentEditingController

Overview

The PHContentEditingController protocol defines methods you implement in a custom view controller class in order to create a Photos extension. The Photos app hosts your extension’s view controller to provide a user interface for editing photo or video assets.

Topics

Working with Adjustment Data

func canHandle(PHAdjustmentData) -> Bool

Asks your extension whether it can continue working with the most recent edit that was made to an asset.

Required.

Performing an Edit

func startContentEditing(with: PHContentEditingInput, placeholderImage: UIImage)

Tells your extension that asset data is available for editing.

Required.

func finishContentEditing(completionHandler: (PHContentEditingOutput?) -> Void)

Asks your extension for edited asset data to finish the editing session.

Required.

Canceling an Edit

var shouldShowCancelConfirmation: Bool

A Boolean value that determines whether Photos should prompt the user when canceling the editing session.

Required.

func cancelContentEditing()

Tells your extension to cancel editing.

Required.

Relationships

Inherits From

See Also

Photo Editing Extensions

Creating Photo Editing Extensions

Allow your app to edit assets directly within the Photos app.

class PHEditingExtensionContext

An object that provides Photos editing extensions with access to the underlying project and photo library.

Deprecated