---
title: "revealDocument(at:importIfNeeded:completion:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uidocumentbrowserviewcontroller/revealdocument(at:importifneeded:completion:)"
---

# revealDocument(at:importIfNeeded:completion:)

Reveals, and optionally imports, the document at the provided URL.

## Declaration

```swift
func revealDocument(at url: URL, importIfNeeded: Bool, completion: ((URL?, (any Error)?) -> Void)? = nil)
```

```swift
func revealDocument(at url: URL, importIfNeeded: Bool) async throws -> URL
```

## Parameters

- `url`: The URL of the document to reveal.
- `importIfNeeded`: A Boolean value that determines whether the document browser should import the document.
- `completion`: A completion block with the following parameters:

## Mentioned in

Enabling document sharing

## Discussion

Discussion Call this method to display a document in the document browser. If importIfNeeded is true, the document browser calls its delegate’s documentBrowser(_:didImportDocumentAt:toDestinationURL:) method (or its documentBrowser(_:failedToImportDocumentAt:error:) method, if an error occurred) before calling the completion handler.

## See Also

### Configuring a document browser

- [allowsDocumentCreation](uikit/uidocumentbrowserviewcontroller/allowsdocumentcreation.md)
- [allowsPickingMultipleItems](uikit/uidocumentbrowserviewcontroller/allowspickingmultipleitems.md)
- [contentTypesForRecentDocuments](uikit/uidocumentbrowserviewcontroller/contenttypesforrecentdocuments.md)
