---
title: "init(_:)"
framework: uikit
role: symbol
role_heading: Initializer
path: "uikit/uideferredmenuelement/init(_:)"
---

# init(_:)

A convenience initializer that creates a placeholder menu element that the system replaces with the result of the provider’s completion handler.

## Declaration

```swift
convenience init(_ elementProvider: @escaping (@escaping ([UIMenuElement]) -> Void) -> Void)
```

## Parameters

- `elementProvider`: The closure the system calls to request the deferred menu items.

## Discussion

Discussion The system calls each element’s closure once, when it first encounters the element in a menu. Once provided, the system caches the element and may reuse it across menus. You can use uncached(_:) to initialize a deferred menu element without caching. With caching disabled, the system calls the provider closure each time it displays the element.

## See Also

### Creating a deferred menu element

- [uncached(_:)](uikit/uideferredmenuelement/uncached(_:).md)
- [usingFocus(identifier:shouldCacheItems:)](uikit/uideferredmenuelement/usingfocus(identifier:shouldcacheitems:).md)
