A specialized view for previewing an item.
SDKs
- iOS 4.0+
- Mac Catalyst 13.0+
Framework
- Quick
Look
Declaration
class QLPreviewController : UIView Controller
Overview
A displayed preview includes a title taken from the last path component of the item URL. You can override this by implementing a preview
accessor for the preview item.
A QLPreview
can display previews for the following items:
iWork documents
Microsoft Office documents (Office ‘97 and newer)
Rich Text Format (RTF) documents
PDF files
Images
Text files whose uniform type identifier (UTI) conforms to the
public
type (see Uniform Type Identifiers Reference).text Comma-separated value (csv) files
3D models in USDZ format (with both standalone and AR views for viewing the model)
A QLPreview
can be presented modally (that is, full-screen) by calling present(_:
from a presenting UIView
, or it can be pushed into view using a UINavigation
.
To use a Quick Look preview controller, you must provide a data source object. The data source provides preview items to the controller and tells it how many items to include in a preview navigation list. If there is more than one item in the list, a modally-presented controller displays navigation arrows to let the user switch among the items. For a Quick Look preview controller pushed using a navigation controller, you can provide buttons in the navigation bar for moving through the navigation list.
For details on providing items to a preview controller, refer to QLPreview
and QLPreview
.