---
title: "documentBrowser(_:didImportDocumentAt:toDestinationURL:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uidocumentbrowserviewcontrollerdelegate/documentbrowser(_:didimportdocumentat:todestinationurl:)"
---

# documentBrowser(_:didImportDocumentAt:toDestinationURL:)

Tells the delegate that a document has been successfully imported.

## Declaration

```swift
optional func documentBrowser(_ controller: UIDocumentBrowserViewController, didImportDocumentAt sourceURL: URL, toDestinationURL destinationURL: URL)
```

## Parameters

- `controller`: The document browser that performed the import action.
- `sourceURL`: The document’s original URL.
- `destinationURL`: The document’s URL after the import.

## Mentioned in

Enabling document sharing

## Discussion

Discussion To open the document as soon as it’s imported: Open a new UIDocument subclass for the document (or use a file presenter and file coordination to access the document). Create a view controller to display the document. Present that view controller modally.

## See Also

### Creating new documents

- [documentBrowser(_:didRequestDocumentCreationWithHandler:)](uikit/uidocumentbrowserviewcontrollerdelegate/documentbrowser(_:didrequestdocumentcreationwithhandler:).md)
- [UIDocumentBrowserViewController.ImportMode](uikit/uidocumentbrowserviewcontroller/importmode.md)
- [documentBrowser(_:failedToImportDocumentAt:error:)](uikit/uidocumentbrowserviewcontrollerdelegate/documentbrowser(_:failedtoimportdocumentat:error:).md)
