iOS Developer Library

Developer

QuickLook Framework Reference QLPreviewController Class Reference

Options
Deployment Target:

On This Page
Language:

QLPreviewController

A QLPreviewController object, or Quick Look preview controller, provides a specialized view for previewing an item. To display a Quick Look preview controller you have two options: You can push it into view using a UINavigationController object, or can present it modally, full screen, using the presentModalViewController:animated: method of its parent class, UIViewController. More...

Inheritance


Import Statement


import QuickLook @import QuickLook;

Availability


Available in iOS 4.0 and later.
  • Indicates whether or not the Quick Look preview controller can display an item.

    Declaration

    Swift

    class func canPreviewItem(_ item: QLPreviewItem!) -> Bool

    Objective-C

    + (BOOL)canPreviewItem:(id<QLPreviewItem>)item

    Parameters

    item

    An item to be previewed.

    Return Value

    Returns YEStrue if the Quick Look preview controller can display the specified preview item.

    Discussion

    If an item cannot be displayed, but you still attempt to display it, a Quick Look preview controller displays a generic error. Always check if an item can be displayed before choosing whether or not to display it.

    Refer to this document’s Overview section (QLPreviewController) for the types of items that a Quick Look preview controller can display.

    Import Statement

    import QuickLook

    Availability

    Available in iOS 4.0 and later.

  • The item currently displayed in the Quick Look preview controller. (read-only)

    Declaration

    Swift

    var currentPreviewItem: QLPreviewItem! { get }

    Objective-C

    @property(readonly) id< QLPreviewItem > currentPreviewItem

    Discussion

    If no item is being displayed, this property’s value is nil.

    Import Statement

    import QuickLook

    Availability

    Available in iOS 4.0 and later.

  • The index, within the preview item navigation list, of the item currently displayed in the Quick Look preview controller.

    Declaration

    Swift

    var currentPreviewItemIndex: Int

    Objective-C

    @property NSInteger currentPreviewItemIndex

    Discussion

    You can change which item is displayed, among those in a navigation list, by setting this property’s value. If no item is being displayed, this property’s value is NSNotFound.

    Import Statement

    import QuickLook

    Availability

    Available in iOS 4.0 and later.

  • Asks the Quick Look preview controller to recompute the display of the current preview item.

    Declaration

    Swift

    func refreshCurrentPreviewItem()

    Objective-C

    - (void)refreshCurrentPreviewItem

    Discussion

    The display is recomputed whether or not the current preview item has changed.

    Import Statement

    import QuickLook

    Availability

    Available in iOS 4.0 and later.

  • Asks the Preview Controller to reload its data from its data source.

    Declaration

    Swift

    func reloadData()

    Objective-C

    - (void)reloadData

    Discussion

    The display is recomputed only if the current preview item has changed.

    Import Statement

    import QuickLook

    Availability

    Available in iOS 4.0 and later.