<!--
{
  "availability" : [
    "iOS: 11.0.0 - 14.0.0",
    "iPadOS: 11.0.0 - 14.0.0",
    "macCatalyst: 13.1.0 - 14.0.0",
    "visionOS: 1.0.0 - 1.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIDocumentBrowserViewController/init(forOpeningFilesWithContentTypes:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIDocumentBrowserViewController(im)initForOpeningFilesWithContentTypes:"
  },
  "title" : "init(forOpeningFilesWithContentTypes:)"
}
-->

# init(forOpeningFilesWithContentTypes:)

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

```
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 [Set the supported document types](/documentation/UIKit/setting-up-a-document-browser-app#Set-the-supported-document-types)     section of [Setting up a document browser app](/documentation/UIKit/setting-up-a-document-browser-app)    .

    For more information about UTIs, see     <doc://com.apple.documentation/documentation/UniformTypeIdentifiers>    .

## Return Value

Returns a newly initialized document browser view controller.

## Discussion

---

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)