Contents

Quick Look

Create previews of files to use inside your app, or perform simple edits on previews.

Overview

When showing files in your app, including the ability to quickly preview a file and its content can be helpful to your users. For example, you may want to allow users to zoom into a photo, play back an audio file, and so on. Use the Quick Look framework to show a preview of common file types in your app that allows basic interactions. Quick Look can generate previews for common file types, including:

  • iWork and Microsoft Office documents

  • Images

  • Live Photos

  • Text files

  • PDFs

  • Audio and video files

  • 3D models that use the USDZ file format

In iOS and iPadOS, Quick Look can also present a USDZ model in an augmented reality view.

On iOS devices, the Quick Look framework provides functionality for performing simple edits on previews of common file types; for example, users can add markup to an image. To perform more advanced edits on files, provide advanced playback features, display a file’s content next to text, or add views on top of the preview, use lower-level APIs. For example, use AVPlayer to provide advanced video playback features.

You can provide previews for your own data types by either rendering a view with your own view controller or by returning a supported preview format, such as PDF or HTML.

Providing Quick Look previews for your data types

To provide Quick Look previews for your own file types, create a Quick Look preview extension with either a view controller or data-based preview. In either case, add your supported content types to the QLSupportedContentTypes array in the Info.plist file of the extension.

To provide a view controller-based preview extension, set up a UIViewController that conforms to QLPreviewingController. Prepare and display the view within the preparePreviewOfFile(at:completionHandler:) method.

To provide a data-based preview extension, implement a subclass of QLPreviewProvider to provide a QLPreviewReply based on the QLFilePreviewRequest that the system provides.

Import QuickLook to use these extension types in iOS and iPadOS. In macOS, the same types are part of Quick Look UI, so import QuickLookUI instead.

Topics

Previews

Preview extensions

Data-based preview extensions

Classes

Structures

Type Aliases