---
title: "init(forOpening:)"
framework: uikit
role: symbol
role_heading: Initializer
path: "uikit/uidocumentbrowserviewcontroller/init(foropening:)"
---

# init(forOpening:)

Initializes and returns a document browser view controller that can open the specified file types.

## Declaration

```swift
init(forOpening contentTypes: [UTType]?)
```

## Parameters

- `contentTypes`: An array of uniform type identifiers. If nil, the browser uses the document types that the doc://com.apple.documentation/documentation/BundleResources/Information-Property-List/CFBundleDocumentTypes key specifies in the app’s Info.plist file. For detailed instructions about setting the CFBundleDocumentTypes key, see doc://com.apple.uikit/documentation/UIKit/setting-up-a-document-browser-app. For more information about type identifiers, see doc://com.apple.documentation/documentation/UniformTypeIdentifiers.

## See Also

### Creating a document browser

- [Adding a document browser to your app](uikit/adding-a-document-browser-to-your-app.md)
