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

# init(forOpening:)

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

```
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 [Setting up a document browser app](/documentation/UIKit/setting-up-a-document-browser-app)    .

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

---

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)