Class

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.

Declaration

class PHProjectExtensionContext : NSExtensionContext

Overview

When a Photos project extension is initialized, it is handed an extension context object. This object provides the extension with access to the underlying project, as well as the photo library from which assets are fetched and edited.

Topics

Accessing the Project and the Photo Library

var project: PHProject

A read-only version of the project being edited.

var photoLibrary: PHPhotoLibrary

A read-only version of the photo library being modified.

Updating Assets

func showEditor(for: PHAsset)

Invokes the built-in photo editor for the given asset.

func updatedProjectInfo(from: PHProjectInfo?, completion: (PHProjectInfo?) -> Void) -> Progress

Creates an updated PHProjectInfo instance from existing project information and current assets.

Relationships

Inherits From

Conforms To

See Also

macOS Photos Project Extensions

Creating a Slideshow Project Extension for Photos

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

class PHProject

A representation of a Photos app project extension.

class PHProjectInfo

Information about the project extension.

class PHProjectElement

The superclass for all element objects.

class PHProjectSection

A collection of content representing curated asset and text elements.

class PHProjectRegionOfInterest

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

class PHProjectChangeRequest

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

protocol PHProjectExtensionController

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

class PHCloudIdentifier

A cloud identifier for a Photos project extension.

struct PHProjectCategory

A representation of Photos project extension categories.