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

# init(forOpeningFilesWithContentTypes:)

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

## Declaration

```swift
init(forOpeningFilesWithContentTypes allowedContentTypes: [String]?)
```

## Parameters

- `allowedContentTypes`: An array of uniform type identifiers (UTIs). The document browser can open only the document types that these UTIs specify. If you pass nil, the browser uses the document types that the CFBundleDocumentTypes key specifies in the app’s Info.plist file. For detailed instructions about setting the CFBundleDocumentTypes key, see the doc://com.apple.uikit/documentation/UIKit/setting-up-a-document-browser-app#Set-the-supported-document-types section of doc://com.apple.uikit/documentation/UIKit/setting-up-a-document-browser-app. For more information about UTIs, see doc://com.apple.documentation/documentation/UniformTypeIdentifiers.

## Mentioned in

Customizing the document browser

## Return Value

Return Value Returns a newly initialized document browser view controller.

## See Also

### Deprecated symbols

- [recentDocumentsContentTypes](uikit/uidocumentbrowserviewcontroller/recentdocumentscontenttypes.md)
- [allowedContentTypes](uikit/uidocumentbrowserviewcontroller/allowedcontenttypes.md)
- [transitionController(forDocumentURL:)](uikit/uidocumentbrowserviewcontroller/transitioncontroller(fordocumenturl:).md)
