---
title: "init(document:)"
framework: uikit
role: symbol
role_heading: Initializer
path: "uikit/uidocumentviewcontroller/init(document:)"
---

# init(document:)

Creates a document view controller with a document.

## Declaration

```swift
init(document: UIDocument?)
```

## Parameters

- `document`: The document that the view controller presents.

## Return Value

Return Value A newly initialized UIDocumentViewController object.

## Discussion

Discussion The document view controller opens and displays the document that you specify. If you don’t provide custom values, the new view controller gets its title and other information from the document itself.
