---
title: "previewController(_:transitionImageFor:contentRect:)"
framework: quicklook
role: symbol
role_heading: Instance Method
path: "quicklook/qlpreviewcontrollerdelegate/previewcontroller(_:transitionimagefor:contentrect:)"
---

# previewController(_:transitionImageFor:contentRect:)

Tells the delegate that the system is about to present the preview full screen or dismiss it, and asks for information to provide a smooth transition when zooming.

## Declaration

```swift
optional func previewController(_ controller: QLPreviewController, transitionImageFor item: any QLPreviewItem, contentRect: UnsafeMutablePointer<CGRect>) -> UIImage?
```

## Parameters

- `controller`: The doc://com.apple.quicklook/documentation/QuickLook/QLPreviewController that’s requesting the image for the preview item.
- `item`: The item to preview or dismiss.
- `contentRect`: The rectangle within the image that represents the document content. For icons, for example, the document content rectangle is typically smaller than the icon rectangle itself.

## Return Value

Return Value A UIImage object that the preview controller cross-fades with when zooming.

## Discussion

Discussion note: Starting with macOS 11, animated transitions are available for Mac apps built with Mac Catalyst. On Mac computers running a version earlier than macOS 11, the system doesn’t call this delegate method.

## See Also

### Responding to preview requests

- [previewController(_:frameFor:inSourceView:)](quicklook/qlpreviewcontrollerdelegate/previewcontroller(_:framefor:insourceview:).md)
- [previewController(_:transitionViewFor:)](quicklook/qlpreviewcontrollerdelegate/previewcontroller(_:transitionviewfor:).md)
- [previewControllerWillDismiss(_:)](quicklook/qlpreviewcontrollerdelegate/previewcontrollerwilldismiss(_:).md)
- [previewControllerDidDismiss(_:)](quicklook/qlpreviewcontrollerdelegate/previewcontrollerdiddismiss(_:).md)
