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


@interface PHAssetCollection : 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 an asset collection, fetch them with a PHAsset class method such as fetchAssetsInAssetCollection:options:. To find asset collections, use one of the methods listed in Fetching Asset Collections.

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


Fetching Asset Collections

+ fetchAssetCollectionsWithLocalIdentifiers:options:

Retrieves asset collections with the specified unique identifiers.

+ fetchAssetCollectionsWithType:subtype:options:

Retrieves asset collections of the specified type and subtype.

+ fetchAssetCollectionsContainingAsset:withType:options:

Retrieves asset collections of the specified type containing the specified asset.

+ fetchAssetCollectionsWithALAssetGroupURLs:options:

Retrieves asset collections using URLs provided by the Assets Library framework.

+ fetchMomentsInMomentList:options:

Retrieves asset collections in the specified moment list collection.

+ fetchMomentsWithOptions:

Retrieves asset collections corresponding to moments seen in the Photos app.


Reading Asset Collection Metadata


The type of the asset collection, such as an album or a moment.


Major distinctions between kinds of asset collections, used by the assetCollectionType property and the fetchAssetCollectionsContainingAsset:withType:options: and fetchAssetCollectionsWithType:subtype:options: methods.


The subtype of the asset collection.


Minor distinctions between kinds of asset collections, used by the assetCollectionSubtype property and the fetchAssetCollectionsWithType:subtype:options: method.


The estimated number of assets in the asset collection.


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


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


A location representing those of all assets in the collection.


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

Creating Temporary Asset Collections

+ transientAssetCollectionWithAssets:title:

Creates a temporary asset collection containing the specified assets.

+ transientAssetCollectionWithAssetFetchResult:title:

Creates a temporary asset collection containing the assets from the specified fetch result.


Inherits From

See Also

Asset Retrieval

Fetching Objects and Requesting Changes

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


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


The abstract superclass for Photos asset collections and collection lists.


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


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


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


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

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software