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


class PHFetchOptions : NSObject


Using class methods on the PHAsset, PHCollection, PHAssetCollection, and PHCollectionList classes to fetch assets or collections produces a PHFetchResult object containing the requested objects. The options you specify control which objects the fetch result includes, how those objects are arranged in the fetch result, and how Photos should notify your app of changes to the fetch result.

Photos supports only a restricted set of keys for the predicate and sortDescriptors properties. The set of available keys depends on which class you’re using to fetch assets or collections—see Table 1 for the list of keys supported by each class.

Table 1

Supported predicate and sort descriptor keys

Class for Fetch Method

Supported Keys


SELF, localIdentifier, creationDate, modificationDate, mediaType, mediaSubtypes, duration, pixelWidth, pixelHeight, isFavorite (or isFavorite), isHidden (or isHidden), burstIdentifier


SELF, localIdentifier, localizedTitle (or title), startDate, endDate, estimatedAssetCount


SELF, localIdentifier, localizedTitle (or title), startDate, endDate

PHCollection (can fetch a mix of PHCollectionList and PHAssetCollection objects)

SELF, localIdentifier, localizedTitle (or title), startDate, endDate


Sorting and Filtering Fetch Results

var predicate: NSPredicate?

A predicate that specifies which properties to select results by and that also specifies any constraints on selection.

var sortDescriptors: [NSSortDescriptor]?

A list of sort descriptors, specifying an order for the fetched objects.

Subscribing to Changes

var wantsIncrementalChangeDetails: Bool

A Boolean value that determines whether your app receives detailed change information for the objects in the fetch result.

Limiting Fetch Results

var fetchLimit: Int

The maximum number of objects to include in the fetch result.

var includeAllBurstAssets: Bool

A Boolean value that determines whether the fetch result includes all assets from burst photo sequences.

var includeHiddenAssets: Bool

A Boolean value that determines whether the fetch result includes assets marked as hidden.

var includeAssetSourceTypes: PHAssetSourceType

The set of source types for which to include assets in the fetch result.


Inherits From

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 PHCollectionList

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

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.