<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "QuickLook",
  "identifier" : "/documentation/QuickLook/QLPreviewController/canPreview(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Quick Look"
    ],
    "preciseIdentifier" : "c:objc(cs)QLPreviewController(cm)canPreviewItem:"
  },
  "title" : "canPreview(_:)"
}
-->

# canPreview(_:)

Returns a Boolean value that indicates whether the preview controller can display an item.

```
class func canPreview(_ item: any QLPreviewItem) -> Bool
```

## Parameters

`item`

An item to preview.

## Return Value

Returns <doc://com.apple.documentation/documentation/Swift/true> if the Quick Look preview controller can display the specified preview item.

## Discussion

If the system can’t display an item, but you still attempt to display it, a Quick Look preview controller displays a generic error. Always check whether you can display an item before choosing to do so.

For supported file types, see [`QLPreviewController`](/documentation/QuickLook/QLPreviewController).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)