---
title: "replacingChildren(_:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uimenu/replacingchildren(_:)"
---

# replacingChildren(_:)

Creates a new menu with the same configuration as the current menu, but with a new set of child elements.

## Declaration

```swift
func replacingChildren(_ newChildren: [UIMenuElement]) -> UIMenu
```

## Parameters

- `newChildren`: The child elements to include in the new menu.

## Return Value

Return Value A new menu object containing the specified children.

## Discussion

Discussion The new menu contains the same title, image, identifier, and options as the current menu. The new menu contains only the children in the newChildren parameter. It doesn’t contain any child elements from the current menu.

## See Also

### Accessing child elements

- [children](uikit/uimenu/children.md)
