Class

PHChange

A description of a change that occurred in the Photos library.

Overview

Photos provides PHChange objects to notify your app of changes to the assets and collections managed by the Photos app. To receive change information, adopt the PHPhotoLibraryChangeObserver protocol and register your observer with the shared PHPhotoLibrary object.

After Photos provides you with a change object, you use its methods to get a change details object. Call the changeDetails(for:) or changeDetails(for:) method, passing an asset or collection object you’ve previously fetched or a fetch result containing several such objects. The resulting PHObjectChangeDetails or PHFetchResultChangeDetails object describes any changes that have happened to the object or fetch result since you last fetched it.

Topics

Getting Change Details

func changeDetails<T>(for: T)

Returns detailed change information for the specified asset or collection.

func changeDetails<T>(for: PHFetchResult<T>)

Returns detailed change information for a fetch result.

Instance Methods

func changeDetails(for: PHFetchResult<AnyObject>)

Returns detailed change information for a fetch result.

func changeDetails(for: PHObject)

Returns detailed change information for the specified asset or collection.

Relationships

Inherits From

Conforms To

See Also

Observing Changes

protocol PHPhotoLibraryChangeObserver

A protocol you can implement to be notified of changes that occur in the Photos library.

class PHObjectChangeDetails

A description of changes that occurred in an asset or collection object.

class PHFetchResultChangeDetails

A description of changes that occurred in the set of asset or collection objects listed in a fetch result.