Photos provides access to the user's photo and video library, letting you fetch, manage, and edit assets, albums, and their underlying resources. You query the library with PHFetchOptions and PHFetchResult, work with PHAsset, PHAssetCollection, and PHCollectionList, and request images, Live Photos, or video through PHImageManager, PHCachingImageManager, and options types such as PHImageRequestOptions, PHLivePhotoRequestOptions, and PHVideoRequestOptions. To modify the library, you submit change requests like PHAssetChangeRequest, PHAssetCreationRequest, and PHAssetCollectionChangeRequest, and observe updates with PHChange and PHFetchResultChangeDetails. The framework also supports editing workflows via PHContentEditingInput, PHContentEditingOutput, and PHLivePhotoEditingContext, and background upload of asset resources through PHAssetResource, PHAssetResourceManager, and PHAssetResourceUploadJob.
Assets and Collections 6
The principal model objects that represent photos, videos, albums, and album groupings in the user's library.
- ClPHObjectmacOS 10.13+The abstract base class for Photos model objects such as assets and collections.
- ClPHAssetmacOS 10.13+A representation of an image, video, or Live Photo in the user's photo library.
- ClPHCollectionmacOS 10.13+The abstract base class for ordered groupings of Photos assets, including albums and album lists.
- ClPHAssetCollectionmacOS 10.13+A collection of related assets, such as an album or a moment.
- ClPHCollectionListmacOS 10.13+An ordered group of collections, such as a folder of albums or a set of moments.
- ClPHObjectPlaceholdermacOS 10.15+A read-only proxy for a Photos object that is being created within a change request.
The Photo Library 3
The entry point for accessing the library and requesting the user's authorization.
- ClPHPhotoLibrarymacOS 10.13+The shared object that mediates access to the photo library and submits change requests.
- EnPHAuthorizationStatusmacOS 10.13+Constants that indicate your app's authorization to access the photo library.
- EnPHAccessLevelmacOS 10.13+Constants that specify whether your app requests add-only or full read-write library access.
Fetching Assets and Collections 2
Types that query the library and return ordered, change-tracked results.
- ClPHFetchOptionsmacOS 10.13+An object that defines filtering, sorting, and other criteria for fetching Photos objects.
- ClPHFetchResultmacOS 10.13+An ordered, change-tracked collection of assets or collections returned by a fetch.
Requesting Images and Media 13
Managers and options for loading images, Live Photos, and video from assets at the size and quality you need.
- ClPHImageManagermacOS 10.13+An object that loads and caches image and video data for assets on demand.
- ClPHCachingImageManagermacOS 10.15+An image manager that prefetches and caches image data for a set of assets to improve performance.
- ClPHImageRequestOptionsmacOS 10.13+Options that specify how Photos delivers a requested image, including version, quality, and resizing.
- ClPHLivePhotoRequestOptionsmacOS 10.15+Options that specify how Photos delivers a requested Live Photo.
- ClPHVideoRequestOptionsmacOS 10.15+Options that specify how Photos delivers requested video data.
- ClPHLivePhotomacOS 10.12+A representation of a Live Photo, combining a still image with motion and sound.
- PrPHLivePhotoFramemacOS 10.12+Protocol that describes a single frame of a live photo
- EnPHImageContentModemacOS 10.11+Constants that specify how a requested image is fit within or filled to its target size.
- EnPHImageRequestOptionsVersionmacOS 10.13+Constants that specify which version of an asset's image to request.
- EnPHImageRequestOptionsDeliveryModemacOS 10.13+Constants that specify the trade-off between speed and quality when delivering an image.
- EnPHImageRequestOptionsResizeModemacOS 10.13+Constants that specify how Photos resizes a requested image relative to the target size.
- EnPHVideoRequestOptionsVersionmacOS 10.15+Constants that specify which version of an asset's video to request.
- EnPHVideoRequestOptionsDeliveryModemacOS 10.15+Constants that specify the trade-off between speed and quality when delivering video.
Changing the Library 6
Change requests you submit inside a library performChanges block to create, modify, or delete assets and collections.
- ClPHChangeRequestmacOS 10.15+The abstract base class for requests that modify the contents of the photo library.
- ClPHAssetChangeRequestmacOS 10.15+A request to modify or delete an existing asset within a library change block.
- ClPHAssetCreationRequestmacOS 10.15+A request to create a new asset from image, video, or resource data.
- ClPHAssetCollectionChangeRequestmacOS 10.15+A request to create, modify, or delete an asset collection within a library change block.
- ClPHCollectionListChangeRequestmacOS 10.15+A request to create, modify, or delete a collection list within a library change block.
- ClPHAssetResourceCreationOptionsmacOS 10.15+Options that configure how a resource is added when creating an asset.
Observing Library Changes 5
Objects and protocols that notify your app when the contents of the library change.
- ClPHChangemacOS 10.13+An object that describes the changes Photos made to the library since a previous state.
- ClPHObjectChangeDetailsmacOS 10.13+Details about how an individual Photos object changed in a library update.
- ClPHFetchResultChangeDetailsmacOS 10.13+Details about how the contents of a fetch result changed, including insertions, deletions, and moves.
- PrPHPhotoLibraryChangeObservermacOS 10.13+A protocol your object adopts to receive notifications when the photo library changes.
- PrPHPhotoLibraryAvailabilityObservermacOS 10.15+A protocol your object adopts to be notified when the photo library becomes unavailable or available.
Persistent Change Tracking 5
Types for tracking library changes that persist across launches using stored change tokens.
- ClPHPersistentChangemacOS 13+A change to the photo library that can be tracked across app launches.
- ClPHPersistentChangeFetchResultmacOS 13+An ordered collection of persistent changes fetched between two change tokens.
- ClPHPersistentChangeTokenmacOS 13+An opaque marker that identifies a point in the library's persistent change history.
- ClPHPersistentObjectChangeDetailsmacOS 13+Details about how a Photos object changed within a persistent change.
- PrPHPhotoLibraryPersistentChangesObservermacOS 27+A protocol your object adopts to receive persistent change notifications from the library.
Editing Asset Content 8
Inputs, outputs, and contexts for reading editable asset content and applying nondestructive edits.
- ClPHContentEditingInputmacOS 10.11+The editable content of an asset, supplied to your app when it begins editing.
- ClPHContentEditingInputRequestOptionsmacOS 10.15+Options that configure how an asset's editable content is requested.
- ClPHContentEditingOutputmacOS 10.11+The edited content and adjustment data your app provides to save changes to an asset.
- ClPHAdjustmentDatamacOS 10.11+Opaque data that records the edits applied to an asset so they can be reapplied or reverted.
- ClPHLivePhotoEditingContextmacOS 10.12+A context for applying edits to the photo and video tracks of a Live Photo.
- StPHLivePhotoEditingOptionmacOS 10.12+Keys that configure a Live Photo editing operation.
- EnPHLivePhotoFrameTypemacOS 10.12+The type of frame in the Live Photo
- EnPHLivePhotoEditingErrorCodemacOS 10.12+Error code for Live Photo Editing errors (Deprecated)
Asset Resources 8
The underlying data resources of assets and the manager used to read them or upload them in the background.
- ClPHAssetResourcemacOS 10.15+A data resource that backs an asset, such as its original photo, video, or adjustment data.
- ClPHAssetResourceManagermacOS 10.15+An object that reads the underlying data of an asset's resources.
- ClPHAssetResourceRequestOptionsmacOS 10.15+Options that configure how an asset resource's data is requested.
- EnPHAssetResourceTypemacOS 10.11+Constants that identify the kind of data a given asset resource contains.
- ClPHAssetResourceUploadJobmacOS 27.0+An object that represents a request to upload an asset resource.
- ClPHAssetResourceUploadJobChangeRequestmacOS 27.0+Use within an application's `com.apple.photos.background-upload` extension to create and change ``PHAssetResourceUploadJob`` records.
- PrPHBackgroundResourceUploadJobExtensionA protocol for an extension that performs background uploads of asset resources.
- EnPHBackgroundResourceUploadProcessingResultConstants that report the outcome of processing a background resource upload job.
Projects 2
Types that let a Photos project extension represent and modify a user's photo project.
- ClPHProjectmacOS 10.13+A representation of a user's photo project provided to a project extension.
- ClPHProjectChangeRequestmacOS 10.13+A request that a project extension uses to modify the contents of a photo project.
Cloud Identifiers 2
Stable identifiers that map local objects to their counterparts across a user's iCloud Photos libraries.
- ClPHCloudIdentifiermacOS 10.13+A stable identifier that maps a local Photos object to its counterpart in iCloud Photos.
- EnPHObjectTypemacOS 10.11+Constants that identify the type of Photos object a cloud identifier refers to.
Asset and Collection Metadata 10
Enumerations and option sets that describe the kind, source, and capabilities of assets and collections.
- EnPHAssetMediaTypemacOS 10.11+Constants that identify whether an asset is an image, video, or audio item.
- StPHAssetMediaSubtypemacOS 10.11+Options that describe additional characteristics of an asset, such as panorama, HDR, or Live Photo.
- StPHAssetSourceTypemacOS 10.11+Options that indicate how an asset came to be in the library, such as user library or cloud shared.
- StPHAssetBurstSelectionTypemacOS 10.11+Options that indicate how an asset was selected from a burst sequence.
- EnPHAssetEditOperationmacOS 10.11+Options that describe which editing operations are allowed for an asset.
- EnPHAssetCollectionTypemacOS 10.11+Constants that identify the broad type of an asset collection, such as album or moment.
- EnPHAssetCollectionSubtypemacOS 10.11+Constants that identify the specific kind of an asset collection, such as a smart album category.
- EnPHCollectionListTypemacOS 10.11+Constants that identify the broad type of a collection list, such as folder or moment list.
- EnPHCollectionListSubtypemacOS 10.11+Constants that identify the specific kind of a collection list.
- EnPHCollectionEditOperationmacOS 10.11+Options that describe which editing operations are allowed for a collection.
Errors 1
Error types reported by Photos operations.
- StPHPhotosErrormacOS 10.15+Error values reported by Photos framework operations.
Type Aliases 8
- TyPHContentEditingInputRequestID
- TyPHAssetResourceDataRequestID
- TyPHAssetResourceProgressHandler
- TyPHAssetImageProgressHandler
- TyPHAssetVideoProgressHandler
- TyPHImageRequestID
- TyPHLivePhotoRequestID
- TyPHLivePhotoFrameProcessingBlockA block callback for processing frames of a live photo, including the still image