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

# documentInteractionControllerDidEndPreview(_:)

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

## Declaration

```swift
optional func documentInteractionControllerDidEndPreview(_ controller: UIDocumentInteractionController)
```

## Parameters

- `controller`: The document interaction controller that dismissed its document preview.

## Discussion

Discussion This method is called after the view containing the document preview has been removed from the application’s key window. You can use this notification to remove any interface elements you set up behind the preview elements.

## See Also

### Presenting the user interface

- [documentInteractionControllerWillBeginPreview(_:)](uikit/uidocumentinteractioncontrollerdelegate/documentinteractioncontrollerwillbeginpreview(_:).md)
- [documentInteractionControllerWillPresentOptionsMenu(_:)](uikit/uidocumentinteractioncontrollerdelegate/documentinteractioncontrollerwillpresentoptionsmenu(_:).md)
- [documentInteractionControllerDidDismissOptionsMenu(_:)](uikit/uidocumentinteractioncontrollerdelegate/documentinteractioncontrollerdiddismissoptionsmenu(_:).md)
- [documentInteractionControllerWillPresentOpenInMenu(_:)](uikit/uidocumentinteractioncontrollerdelegate/documentinteractioncontrollerwillpresentopeninmenu(_:).md)
- [documentInteractionControllerDidDismissOpenInMenu(_:)](uikit/uidocumentinteractioncontrollerdelegate/documentinteractioncontrollerdiddismissopeninmenu(_:).md)
