<!--
{
  "availability" : [
    "iOS: 3.2.0 -",
    "iPadOS: 3.2.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIDocumentInteractionControllerDelegate/documentInteractionControllerViewForPreview(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UIDocumentInteractionControllerDelegate(im)documentInteractionControllerViewForPreview:"
  },
  "title" : "documentInteractionControllerViewForPreview(_:)"
}
-->

# documentInteractionControllerViewForPreview(_:)

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

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

## Parameters

`controller`

The document interaction controller requesting the starting view.

## 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

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(_:)`](/documentation/UIKit/UIDocumentInteractionControllerDelegate/documentInteractionControllerRectForPreview(_:)) method.

---

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)