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

# UIDocumentInteractionControllerDelegate

A set of methods you can implement to respond to messages from a document interaction controller.

```
protocol UIDocumentInteractionControllerDelegate : NSObjectProtocol
```

## Overview

Use this protocol to participate when document previews are displayed and when a document is about to be opened by another application. You can also use this protocol to respond to commands (such as “copy” and “print”) from a document interaction controller’s options menu.

If you use a document interaction controller to display a document preview, your delegate must implement the [`documentInteractionControllerViewControllerForPreview(_:)`](/documentation/UIKit/UIDocumentInteractionControllerDelegate/documentInteractionControllerViewControllerForPreview(_:)) method. All other methods of this protocol are optional.

For more information about using a document interaction controller, see [`UIDocumentInteractionController`](/documentation/UIKit/UIDocumentInteractionController).

## Topics

### Configuring the parent view controller

[`documentInteractionControllerViewControllerForPreview(_:)`](/documentation/UIKit/UIDocumentInteractionControllerDelegate/documentInteractionControllerViewControllerForPreview(_:))

Called when a document interaction controller needs a view controller for presenting a document preview.

[`documentInteractionControllerViewForPreview(_:)`](/documentation/UIKit/UIDocumentInteractionControllerDelegate/documentInteractionControllerViewForPreview(_:))

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

[`documentInteractionControllerRectForPreview(_:)`](/documentation/UIKit/UIDocumentInteractionControllerDelegate/documentInteractionControllerRectForPreview(_:))

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

### Presenting the user interface

[`documentInteractionControllerWillBeginPreview(_:)`](/documentation/UIKit/UIDocumentInteractionControllerDelegate/documentInteractionControllerWillBeginPreview(_:))

Called when a document interaction controller is about to display a preview for its document.

[`documentInteractionControllerDidEndPreview(_:)`](/documentation/UIKit/UIDocumentInteractionControllerDelegate/documentInteractionControllerDidEndPreview(_:))

Called when a document interaction controller has dismissed its document preview.

[`documentInteractionControllerWillPresentOptionsMenu(_:)`](/documentation/UIKit/UIDocumentInteractionControllerDelegate/documentInteractionControllerWillPresentOptionsMenu(_:))

Called when a document interaction controller is about to display an options menu.

[`documentInteractionControllerDidDismissOptionsMenu(_:)`](/documentation/UIKit/UIDocumentInteractionControllerDelegate/documentInteractionControllerDidDismissOptionsMenu(_:))

Called when a document interaction controller has dismissed its options menu.

[`documentInteractionControllerWillPresentOpenInMenu(_:)`](/documentation/UIKit/UIDocumentInteractionControllerDelegate/documentInteractionControllerWillPresentOpenInMenu(_:))

Called when a document interaction controller is about to display an Open In menu.

[`documentInteractionControllerDidDismissOpenInMenu(_:)`](/documentation/UIKit/UIDocumentInteractionControllerDelegate/documentInteractionControllerDidDismissOpenInMenu(_:))

Called when a document interaction controller has dismissed its Open In menu.

### Opening files

[`documentInteractionController(_:willBeginSendingToApplication:)`](/documentation/UIKit/UIDocumentInteractionControllerDelegate/documentInteractionController(_:willBeginSendingToApplication:))

Called when a document interaction controller’s document is about to be opened by the specified application.

[`documentInteractionController(_:didEndSendingToApplication:)`](/documentation/UIKit/UIDocumentInteractionControllerDelegate/documentInteractionController(_:didEndSendingToApplication:))

Called when a document interaction controller’s document has been handed off to the specified application.

### Deprecated

[`documentInteractionController(_:canPerformAction:)`](/documentation/UIKit/UIDocumentInteractionControllerDelegate/documentInteractionController(_:canPerformAction:))

Called when a document interaction controller needs to know whether the specified action can be performed on the associated document.

[`documentInteractionController(_:performAction:)`](/documentation/UIKit/UIDocumentInteractionControllerDelegate/documentInteractionController(_:performAction:))

Called when a document interaction controller wants its delegate to perform a specified action with the associated document.



---

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)