---
title: "init(forOpeningContentTypes:asCopy:)"
framework: uikit
role: symbol
role_heading: Initializer
path: "uikit/uidocumentpickerviewcontroller/init(foropeningcontenttypes:ascopy:)"
---

# init(forOpeningContentTypes:asCopy:)

Creates and returns a document picker that can open or copy the types of documents you specify.

## Declaration

```swift
init(forOpeningContentTypes contentTypes: [UTType], asCopy: Bool)
```

## Parameters

- `contentTypes`: An array of uniform type identifiers for the document picker to display. For more information, see doc://com.apple.documentation/documentation/UniformTypeIdentifiers.
- `asCopy`: A Boolean value that indicates whether the document picker copies the selected document.

## See Also

### Creating a document picker

- [init(coder:)](uikit/uidocumentpickerviewcontroller/init(coder:).md)
- [init(forExporting:)](uikit/uidocumentpickerviewcontroller/init(forexporting:).md)
- [init(forExporting:asCopy:)](uikit/uidocumentpickerviewcontroller/init(forexporting:ascopy:).md)
- [init(forOpeningContentTypes:)](uikit/uidocumentpickerviewcontroller/init(foropeningcontenttypes:).md)
