---
title: "addOption(withTitle:image:order:handler:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uidocumentmenuviewcontroller/addoption(withtitle:image:order:handler:)"
---

# addOption(withTitle:image:order:handler:)

Adds a custom menu item to the list of document pickers.

## Declaration

```swift
func addOption(withTitle title: String, image: UIImage?, order: UIDocumentMenuOrder, handler: @escaping () -> Void)
```

## Parameters

- `title`: The custom menu item’s title.
- `image`: The custom menu item’s image.
- `order`: The position of this menu item. See doc://com.apple.uikit/documentation/UIKit/UIDocumentMenuOrder for possible values.
- `handler`: A block that is called when the user selects this custom menu item.

## See Also

### Configuring a document menu

- [UIDocumentMenuOrder](uikit/uidocumentmenuorder.md)
