A protocol you can implement to be notified of changes that occur in the photo library.
UIKit for Mac 13.0+Beta
The PHPhotoLibraryChangeObserver protocol notifies you of changes that occur in the Photos library, regardless of whether those changes are made by your app, by a user in the Photos app, or by another app that uses the Photos framework. To receive change messages, register your observer with the photo library’s registerChangeObserver: method. For any assets or collections that you fetch, Photos sends change messages whenever those assets or collections change. Use this protocol to track changes across multiple parts of your app or respond to changes made in another app or extension.
Handling Changes: An Example
The example code below shows how you might implement this protocol in a view controller that uses a UICollectionView interface to display the contents of an album. The view controller keeps a reference to the PHAssetCollection object representing the displayed album and the PHFetchResult object (returned by the fetchAssetsInAssetCollection:options: method) listing the album’s contents. Then, in its photoLibraryDidChange: method, the view controller checks for differences between the objects it fetched and the new state of the photo library, and updates its collection view accordingly.
A description of changes that occurred in the set of asset or collection objects listed in a fetch result.
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.