---
title: "openDocument(completionHandler:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uidocumentviewcontroller/opendocument(completionhandler:)"
---

# openDocument(completionHandler:)

Opens a document in a document view controller from outside the document view controller.

## Declaration

```swift
func openDocument(completionHandler: @escaping (Bool) -> Void)
```

```swift
func openDocument() async -> Bool
```

## Parameters

- `completionHandler`: The function that executes after the document view controller opens the document

## See Also

### Managing the document view

- [document](uikit/uidocumentviewcontroller/document.md)
- [documentDidOpen()](uikit/uidocumentviewcontroller/documentdidopen().md)
