An object that facilitates retrieving or generating preview thumbnails and asset data.
- iOS 8+
- macOS 10.13+
- Mac Catalyst 13.0+Beta
- tvOS 10+
Use these methods to fetch full-size photo assets or thumbnail images, or to retrieve AVFoundation objects for playing, exporting, and manipulating video assets.
To load image or video data:
PHAssetclass to fetch the asset you’re interested in.
defaultmethod to retrieve the shared image manager object.
The image manager caches the asset images and data it provides, so later requests for the same assets with similar parameters will return results more quickly.
If you need to load image data for many assets together, use the
PHCaching class to “preheat” the cache by loading images you expect to need soon. For example, when populating a collection view with photo asset thumbnails, you can cache images ahead of the current scroll position.