Platforms to show: All Mac Windows Linux Cross-Platform

Back to PHCachingImageManagerMBS class.

PHCachingImageManagerMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Photos MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
The constructor.

PHCachingImageManagerMBS.startCachingImagesForAssets(assets() as PHAssetMBS, targetSize as CGSizeMBS, contentMode as Integer, options as PHImageRequestOptionsMBS = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Photos MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS

Prepares image representations of the specified assets for later use.

assets: An array of PHAssetMBS objects for which to prepare image representations.
targetSize: The size of the images to be prepared.
contentMode: An option for how to fit the images to the aspect ratio of the requested size. For details, see PHImageContentMode.
options: Options specifying how Photos should handle the request, format the requested images, and notify your app of progress or errors. For details, see PHImageRequestOptions.

When you call this method, Photos begins to fetch image data and generates thumbnail images on a background thread. At any time afterward, you can use the requestImageForAsset:targetSize method to request individual images from the cache. If Photos has finished preparing a requested image, that method provides the image immediately.

Photos caches images with the exact target size, content mode, and options you specify in this method. If you later request an image with, for example, a different target size than you passed when calling this method, Photos cannot make use of the cache and so it must fetch or generate a new image.

PHCachingImageManagerMBS.stopCachingImagesForAllAssets

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Photos MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Cancels all image preparation that is currently in progress.

PHCachingImageManagerMBS.stopCachingImagesForAssets(assets() as PHAssetMBS, targetSize as CGSizeMBS, contentMode as Integer, options as PHImageRequestOptionsMBS = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Photos MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Cancels image preparation for the specified assets and options.

assets: The array of specific PHAssetMBS objects for which image preparation is in progress but is no longer needed.
targetSize: The target size with which you requested image preparation.
contentMode: The content mode with which you requested image preparation.
options: The options with which you requested image preparation.

This method cancels image preparation for the specified assets with the specified options. Use it when image preparation that might be in progress is no longer needed. For example, if you prepare images for a collection view filled with photo thumbnails and then the user chooses a different thumbnail size for your collection view, call this method to cancel generating thumbnail images at the old size.

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


The biggest plugin in space...