Class

PHObject

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

Declaration

class PHObject : NSObject

Overview

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.

Topics

Identifying an Object

var localIdentifier: String

A unique string that persistently identifies the object.

Relationships

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.

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