Contents

QLPreviewProvider

A class that you subclass to provide a data-based Quick Look preview extension.

Declaration

class QLPreviewProvider

Overview

When you subclass QLPreviewProvider, conform your subclass to QLPreviewingController.

To provide a data-based Quick Look extension, make the following modifications to your Info.plist file:

  • Set the Boolean key QLIsDataBasedPreview to true.

  • Add the type identifiers for your extension’s supported content types to the QLSupportedContentTypes array.

  • Change the value of NSExtensionPrincipalClass to the name of your subclass. For example, if you named your subclass PreviewProvider, set the value to $(PRODUCT_MODULE_NAME).PreviewProvider.

After updating the extension’s Info.plist file, implement the providePreview(for:completionHandler:) method to return a QLPreviewReply for the provided QLFilePreviewRequest.

See Also

Data-based Preview Extensions