Class

PHCollectionList

A group containing Photos asset collections, such as Moments, Years, or folders of user-created albums.

Declaration

@interface PHCollectionList : PHCollection

Overview

In the Photos framework, collection objects (including asset collections) do not directly reference their member objects, and there are no other objects that directly reference collection objects. To retrieve the members of a collection list, fetch them with a PHCollection class method such as fetchCollectionsInCollectionList:options:. To find objects at the root of the collection list hierarchy (such as album folders with no parent folders), use the fetchTopLevelUserCollectionsWithOptions: method.

Like assets and asset collections, collection lists are immutable. To create, rename, or delete collection lists, or to add, remove, or rearrange members in a collection list, create a PHCollectionListChangeRequest object within a photo library change block. For details on using change requests and change blocks to update the photo library, see PHPhotoLibrary.

Topics

Fetching Collection Lists

+ fetchCollectionListsContainingCollection:options:

Retrieves collection lists that contain the specified collection.

+ fetchCollectionListsWithLocalIdentifiers:options:

Retrieves collection lists with the specified local-device-specific unique identifiers.

+ fetchCollectionListsWithType:subtype:options:

Retrieves collection lists of the specified type.

+ fetchMomentListsWithSubtype:containingMoment:options:

Retrieves collection lists of the specified moment list type containing the specified moment.

Deprecated
+ fetchMomentListsWithSubtype:options:

Retrieves collection lists of the specified moment list type.

Deprecated

Reading Collection List Metadata

collectionListType

The type of asset collection group that the collection list represents.

PHCollectionListType

Major distinctions between kinds of collection list, used by the collectionListType property and fetchCollectionListsWithType:subtype:options: method.

collectionListSubtype

The type of asset collection grouping the collection list represents.

startDate

The earliest creation date among all assets in the collection list.

endDate

The latest creation date among all assets in the collection list.

localizedLocationNames

The names of locations grouped by the collection (an array of NSString objects).

Creating Temporary Collection Lists

+ transientCollectionListWithCollections:title:

Creates a temporary collection list that contains the specified asset collections.

+ transientCollectionListWithCollectionsFetchResult:title:

Creates a temporary collection list containing the asset collections in the specified fetch result.

Relationships

Inherits From

See Also

Asset Retrieval

Fetching Objects and Requesting Changes

Get assets, asset collections, and collection lists matching a specified query.

PHAsset

A representation of an image, video, or Live Photo in the Photos library.

PHAssetCollection

A representation of a Photos asset grouping, such as a moment, user-created album, or smart album.

PHCollection

The abstract superclass for Photos asset collections and collection lists.

PHObject

The abstract superclass for Photos model objects (assets and collections).

PHFetchResult

An ordered list of assets or collections returned from a Photos fetch method.

PHFetchOptions

A set of options that affect the filtering, sorting, and management of results that Photos returns when you fetch asset or collection objects.