---
title: "init(url:in:)"
framework: uikit
role: symbol
role_heading: Initializer
path: "uikit/uidocumentmenuviewcontroller/init(url:in:)"
---

# init(url:in:)

Initializes and returns a document menu to export or move the given document.

## Declaration

```swift
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 UIDocumentPickerModeExportToService or UIDocumentPickerModeMoveToService mode.

## Return Value

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

## Discussion

Discussion The resulting document menu displays all the document pickers appropriate for the given mode.

## See Also

### Creating a document menu

- [init(documentTypes:in:)](uikit/uidocumentmenuviewcontroller/init(documenttypes:in:).md)
- [init(coder:)](uikit/uidocumentmenuviewcontroller/init(coder:).md)
