init(documentTypes:in:)
Initializes and returns a document menu to import or open the given file types.
Declaration
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 TP40001319.
- mode:
The type of file transfer operation the document picker performs. This argument accepts only the Import or 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.