Protocol

PHProjectExtensionController

A protocol defining the life cycle and supported types of project extensions.

Declaration

@protocol PHProjectExtensionController

Overview

The principal view controller for a Photos project extension must conform to this protocol. Methods in this protocol define the basic life cycle of the extension controller. They allow you to define any number of project types that your extension supports; the Photos app displays these project types to the user as choices when creating a new project. To enable this entry point into the extension, the Info.plist must include this key/value pair in its NSExtensionAttributes dictionary.

Screenshot showing the slideshow category in the information property list for a Photos project extension.

Once enabled, Photos asks the extension for its list of supported project types. The option that the user selects when creating a project is passed to the extension as an attribute of PHProjectInfo.

Topics

Tracking the Project Extension Life Cycle

- beginProjectWithExtensionContext:projectInfo:completion:

Provides an opportunity to customize the initial state when the user creates a project using the extension.

Required.

- finishProjectWithCompletionHandler:

Provides an opportunity to perform cleanup when a user switches away from the project or terminates the extension.

Required.

- resumeProjectWithExtensionContext:completion:

Provides an opportunity to restore or refresh the user interface when the user returns to a previously created project.

Required.

- typeDescriptionDataSourceForCategory:invalidator:

Fetches the type description data source to provide the user with more information about the project extension category.

Defining Supported Project Types

supportedProjectTypes

An array of project types the extension supports.

Deprecated

Relationships

Inherits From

See Also

macOS Photos Project Extensions

Creating a Slideshow Project Extension for Photos

Augment the macOS Photos app with extensions that support project creation.

PHProject

A representation of a Photos app project extension.

PHProjectInfo

Information about the project extension.

PHProjectExtensionContext

An object that provides Photos project extensions with access to the underlying project, as well as to the user's photo library for editing.

PHProjectElement

The superclass for all element objects.

PHProjectSection

A collection of content representing curated asset and text elements.

PHProjectRegionOfInterest

A representation of a region of interest in a photo asset.

PHProjectChangeRequest

A request to change asset data in a Photos project extension.

PHCloudIdentifier

A cloud identifier for a Photos project extension.

PHProjectCategory

A representation of Photos project extension categories.