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


class PHObject : NSObject


You do not create or use instances of this class directly. Instead, work with instances of its concrete subclasses—PHAsset, PHAssetCollection, PHCollectionList, and PHObjectPlaceholder.

Because the PHObject class implements the isEqual(_:) and hash methods in terms of its localIdentifier property, you can use techniques that depend on these methods to keep track of asset and collection objects.


Identifying an Object

var localIdentifier: String

A unique string that persistently identifies the object.


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 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.