---
title: "canPreview(_:)"
framework: quicklook
role: symbol
role_heading: Type Method
path: "quicklook/qlpreviewcontroller/canpreview(_:)"
---

# canPreview(_:)

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

## Declaration

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

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

## Parameters

- `item`: An item to preview.

## Return Value

Return Value Returns true if the Quick Look preview controller can display the specified preview item.

## Discussion

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.

## See Also

### Managing item previews

- [currentPreviewItem](quicklook/qlpreviewcontroller/currentpreviewitem.md)
- [currentPreviewItemIndex](quicklook/qlpreviewcontroller/currentpreviewitemindex.md)
- [refreshCurrentPreviewItem()](quicklook/qlpreviewcontroller/refreshcurrentpreviewitem().md)
- [reloadData()](quicklook/qlpreviewcontroller/reloaddata().md)
