---
title: "documentInteractionControllerViewForPreview(_:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uidocumentinteractioncontrollerdelegate/documentinteractioncontrollerviewforpreview(_:)"
---

# documentInteractionControllerViewForPreview(_:)

Called when a document interaction controller needs the starting point for animating the display of a document preview.

## Declaration

```swift
optional func documentInteractionControllerViewForPreview(_ controller: UIDocumentInteractionController) -> UIView?
```

## Parameters

- `controller`: The document interaction controller requesting the starting view.

## Return Value

Return Value The view to use as the starting point for the animation or nil if you want the document preview to fade into place.

## Discussion

Discussion By default, the starting rectangle for the animation is set to the bounds of the returned view. To specify a different starting rectangle, you must also override the documentInteractionControllerRectForPreview(_:) method.

## See Also

### Configuring the parent view controller

- [documentInteractionControllerViewControllerForPreview(_:)](uikit/uidocumentinteractioncontrollerdelegate/documentinteractioncontrollerviewcontrollerforpreview(_:).md)
- [documentInteractionControllerRectForPreview(_:)](uikit/uidocumentinteractioncontrollerdelegate/documentinteractioncontrollerrectforpreview(_:).md)
