Class

PHObjectChangeDetails

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

Declaration

@interface PHObjectChangeDetails<__covariant ObjectType> : NSObject

Overview

A PHObjectChangeDetails object provides detailed information about differences between two states of an asset or collection object—one that you previously obtained and an updated state that would result if you fetched that entity again. You observe changes by adopting the PHPhotoLibraryChangeObserver protocol and registering your observer with the shared PHPhotoLibrary object. When Photos notifies your observer of a change, you get change details by passing the object you’re interested in to the changeDetailsForObject: method.

For an asset collection or collection list, a PHObjectChangeDetails object describe changes only to the collection’s properties. If you are instead interested in changes to the collection’s membership, fetch the collection’s contents and use the changeDetailsForFetchResult: method to track changes to the fetch result.

Topics

Getting the Changed Object

objectBeforeChanges

An object that reflects the original state of the asset or collection it represents.

objectAfterChanges

An object that reflects the current state of the asset or collection it represents.

Getting Change Information

assetContentChanged

A Boolean value that indicates whether the asset’s photo or video content has changed.

objectWasDeleted

A Boolean value that indicates whether the object has been deleted from the Photos library.

Relationships

Inherits From

See Also

Observing Changes to the Photo Library

Observing Changes in the Photo Library

Register an observer to be notified of changes to the photo library.

- registerChangeObserver:

Registers an object to receive messages when objects in the photo library change.

- unregisterChangeObserver:

Unregisters an object so that it no longer receives change messages.

PHPhotoLibraryChangeObserver

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

PHChange

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

PHFetchResultChangeDetails

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