<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIDeferredMenuElement/init(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIDeferredMenuElement(cm)elementWithProvider:"
  },
  "title" : "init(_:)"
}
-->

# init(_:)

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

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

## Parameters

`elementProvider`

The closure the system calls to request the deferred menu items.

## 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(_:)`](/documentation/UIKit/UIDeferredMenuElement/uncached(_:)) to initialize a deferred menu element without caching. With caching disabled, the system calls the provider closure each time it displays the element.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)