<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIDocumentViewController/openDocument(completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIDocumentViewController(im)openDocumentWithCompletionHandler:"
  },
  "title" : "openDocument(completionHandler:)"
}
-->

# openDocument(completionHandler:)

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

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

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

## Parameters

`completionHandler`

The function that executes after the document view controller opens the 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)