<!--
{
  "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/documentInteractionControllerRectForPreview(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UIDocumentInteractionControllerDelegate(im)documentInteractionControllerRectForPreview:"
  },
  "title" : "documentInteractionControllerRectForPreview(_:)"
}
-->

# documentInteractionControllerRectForPreview(_:)

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

```
optional func documentInteractionControllerRectForPreview(_ controller: UIDocumentInteractionController) -> CGRect
```

## Parameters

`controller`

The document interaction controller requesting the starting rectangle.

## Return Value

A rectangle in the coordinate system of the view returned by the [`documentInteractionControllerViewForPreview(_:)`](/documentation/UIKit/UIDocumentInteractionControllerDelegate/documentInteractionControllerViewForPreview(_:)) method.

## Discussion

If you do not implement the [`documentInteractionControllerViewForPreview(_:)`](/documentation/UIKit/UIDocumentInteractionControllerDelegate/documentInteractionControllerViewForPreview(_:)) method, or if you do implement it but return a `nil` value, this method is not called. If you do not implement this method, the starting rectangle is assumed to be the bounds of the view returned by the [`documentInteractionControllerViewForPreview(_:)`](/documentation/UIKit/UIDocumentInteractionControllerDelegate/documentInteractionControllerViewForPreview(_:)) 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)