<!--
{
  "availability" : [
    "iOS: 8.0.0 - 11.0.0",
    "iPadOS: 8.0.0 - 11.0.0",
    "macCatalyst: 13.1.0 - 13.1.0"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIDocumentMenuViewController/init(documentTypes:in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIDocumentMenuViewController(im)initWithDocumentTypes:inMode:"
  },
  "title" : "init(documentTypes:in:)"
}
-->

# init(documentTypes:in:)

Initializes and returns a document menu to import or open the given file types.

```
init(documentTypes allowedUTIs: [String], in mode: UIDocumentPickerMode)
```

## Parameters

`allowedUTIs`

An array of uniform type identifiers. UTIs are strings that uniquely identify a file’s type. For more information, see [Uniform Type Identifiers Overview](https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/understanding_utis/understand_utis_intro/understand_utis_intro.html#//apple_ref/doc/uid/TP40001319).

`mode`

The type of file transfer operation the document picker performs. This argument accepts only the [`UIDocumentPickerMode.import`](/documentation/UIKit/UIDocumentPickerMode/import) or [`UIDocumentPickerMode.open`](/documentation/UIKit/UIDocumentPickerMode/open) mode.

## Return Value

Returns an initialized `UIDocumentMenuViewController` object, or `nil` if the object could not be successfully initialized.

## Discussion

The UTI array defines the type of documents that can be imported or opened. The resulting document menu displays all the document pickers appropriate for the given document types and mode.

---

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)