Class

QLThumbnailGenerator

An object that generates thumbnail images based on provided requirements.

Declaration

class QLThumbnailGenerator : NSObject

Topics

Getting the Generator Instance

class var shared: QLThumbnailGenerator

The singleton thumbnail generator instance.

Generating a Thumbnail

func generateBestRepresentation(for: QLThumbnailGenerator.Request, completion: (QLThumbnailRepresentation?, Error?) -> Void)

Generates the best possible thumbnail representation for a file and calls a handler upon completion.

func generateRepresentations(for: QLThumbnailGenerator.Request, update: ((QLThumbnailRepresentation?, QLThumbnailRepresentation.RepresentationType, Error?) -> Void)?)

Generates various thumbnail representations for a file and calls the update handler for each thumbnail representation.

class QLThumbnailGenerator.Request

A request to generate a thumbnail for a file.

Saving a Thumbnail

func saveBestRepresentation(for: QLThumbnailGenerator.Request, to: URL, contentType: String, completion: (Error?) -> Void)

Saves the best representation of thumbnail for a specific request to the specified URL.

Canceling

func cancel(QLThumbnailGenerator.Request)

Cancels the generation of a thumbnail for a given request.

Relationships

Inherits From

Conforms To

See Also

Thumbnail Generation

Creating Quick Look Thumbnails to Preview Files in Your App

Generate thumbnails of images, text files, PDFs, audio files, videos, and more.

class QLThumbnailRepresentation

The representation of a thumbnail.