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


class PHCollectionList : PHCollection


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 fetchCollections(in:options:). To find objects at the root of the collection list hierarchy (such as album folders with no parent folders), use the fetchTopLevelUserCollections(with:) 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.


Reading Collection List Metadata

var collectionListType: PHCollectionListType

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

enum PHCollectionListType

Major distinctions between kinds of collection list, used by the collectionListType property and fetchCollectionLists(with:subtype:options:) method.

var collectionListSubtype: PHCollectionListSubtype

The type of asset collection grouping the collection list represents.

var startDate: Date?

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

var endDate: Date?

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

var localizedLocationNames: [String]

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

Creating Temporary Collection Lists

class func transientCollectionList(with: [PHCollection], title: String?) -> PHCollectionList

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

class func transientCollectionList(withCollectionsFetchResult: PHFetchResult<PHCollection>, title: String?) -> PHCollectionList

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


Inherits From

Conforms To

See Also

Asset Retrieval

Fetching Objects and Requesting Changes

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

class PHAsset

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

class PHAssetCollection

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

class PHCollection

The abstract superclass for Photos asset collections and collection lists.

class PHObject

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

class PHFetchResult

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

class PHFetchOptions

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