Provides methods for retrieving or generating preview thumbnails and full-size image or video data associated with Photos assets.
- iOS 8.0+
- macOS 10.13+
- tvOS 10.0+
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.
default()method 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.