Protocol

PHProjectTypeDescriptionDataSource

A protocol that you use to provide the project with type description data.

Declaration

protocol PHProjectTypeDescriptionDataSource

Overview

An object adheres to this protocol to provide a type description for your app's Photos project extension. You must implement this protocol to provide subtypes, a description, and footer text. You can optionally respond to the system discarding the data source by implementing extensionWillDiscardDataSource().

Topics

Providing Required Fields

func subtypes(for: PHProjectType) -> [PHProjectTypeDescription]

Provides the root-level project type descriptions and descriptions of any promised subtypes with canProvideSubtypes set to true.

Required.

func typeDescription(for: PHProjectType) -> PHProjectTypeDescription?

Provides the updated project type description for previously invalidated project types.

Required.

func footerText(forSubtypesOf: PHProjectType) -> NSAttributedString?

Provides the footer text for the subtypes of the given project type.

Required.

Responding to Removal

func extensionWillDiscardDataSource()

Provides an opportunity to use the data source before it's released.

Relationships

Inherits From

See Also

Determining Project Type

var projectType: PHProjectType

The project type that the user selected from the project extension options.

struct PHProjectType

The type descriptor of a project extension.

var creationSource: PHProjectInfo.CreationSource

The source from which the project was created.

var sections: [PHProjectSection]

An array of project sections, each containing one or more section content objects.

class PHProjectTypeDescription

An extensible enumerator for PHProjectType that's presented to users in the project picker.

protocol PHProjectTypeDescriptionInvalidator

A protocol that you use to tell the project when and how to invalidate type and footer text.

enum PHProjectInfo.CreationSource

Defines the source of a project extension.