Saves the best representation of thumbnail for a specific request to the specified URL.
SDKs
- iOS 13.0+
- macOS 10.15+
- Mac Catalyst 13.0+
Framework
- Quick
Look Thumbnailing
Declaration
Parameters
request
The request that you used to generate a thumbnail.
fileURL
The destination to which you save the generated thumbnail.
contentType
The content type of the thumbnail image that you want to save. Use a type that is supported by
CGImage
, such asDestination k
orUTType PNG k
.UTType JPEG completionHandler
The handler to call when saving the thumbnail to disk.
error
An error object that indicates why saving a thumbnail image failed, or
nil
if saving the thumbnail succeeded.
Discussion
Creating high-quality thumbnails often involves compressing a CGImage as a PNG
or JPEG
file in-process. This task requires more resources than are available in resource-constrained environments such as File Provider Extensions.
Use this method to create and save the thumbnail image outside of your process as it doesn’t impose the same constraints on memory usage.