Platforms to show: All Mac Windows Linux Cross-Platform

PHCachingImageManagerMBS class

Super class: PHImageManagerMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Photos MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
An object that facilitates retrieving or generating preview thumbnails, optimized for batch preloading large numbers of assets.

For quick performance when you are working with many assets, a caching image manager can prepare asset images in the background in order to eliminate delays when you later request individual images. For example, use a caching image manager when you want to populate a collection view or similar UI with thumbnails of photo or video assets.

Much of the key functionality of the PHCachingImageManager class is defined by its superclass, PHImageManagerMBS. For details, see PHImageManagerMBS.

To use a caching image manager:
1. Create a PHCachingImageManager instance. (This step replaces using the shared PHImageManager instance.)
2. Use PHAsset class methods to fetch the assets you’re interested in.
3. To prepare images for those assets, call the startCachingImagesForAssets:targetSize:contentMode:options: method with the target size, content mode, and options you plan to use when later requesting images for each individual asset.
4. When you need an image for an individual asset, call the requestImageForAsset:targetSize:contentMode:options:resultHandler: method, and pass the same parameters you used when preparing that asset.

If the image you request is among those already prepared, the PHCachingImageManager object immediately returns that image. Otherwise, Photos prepares the image on demand and caches it for later use.
Subclass of the PHImageManagerMBS class.

Super class PHImageManagerMBS

Constants

Constant Value Description
PHInvalidImageRequestID 0 A special value provided for asynchronous image requests that cannot be canceled.

Content Modes

Constant Value Description
ContentModeAspectFill 1 Scales the image so that it completely fills the target size.
ContentModeAspectFit 0 Scales the image so that its larger dimension fits the target size.
ContentModeDefault 0 Fits the image to the requested size using the default option, PHImageContentModeAspectFit. more

This class has no sub classes.


The items on this page are in the following plugins: MBS Mac64bit Plugin.


PHAssetResourceRequestOptionsMBS   -   PHChangeMBS


The biggest plugin in space...