Initializer

init(url:in:)

Initializes and returns a document picker that can export or move the given document.

Declaration

init(url: URL, in mode: UIDocumentPickerMode)

Parameters

url

The document to be exported or moved.

mode

The type of file-transfer operation that the document picker performs. This argument accepts only the UIDocumentPickerMode.exportToService or UIDocumentPickerMode.moveToService mode.

Return Value

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

Discussion

In iOS 10 and earlier, this method returns the document picker view controller from the most recently used Document Provider extension. If no valid Document Provider can be found, it defaults back to iCloud Drive.

In iOS 11 and later, it returns the standard browser interface. This interface is the same one used by the UIDocumentBrowserViewController class.

See Also

Creating a Document Picker

init(documentTypes: [String], in: UIDocumentPickerMode)

Initializes and returns a document picker that can import or open the given file types.

init(urls: [URL], in: UIDocumentPickerMode)

Initializes and returns a document picker that can export or move the given documents.

init?(coder: NSCoder)

Returns an object initialized from data in a given unarchiver.