---
title: "setItems(_:animated:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uitoolbar/setitems(_:animated:)"
---

# setItems(_:animated:)

Sets the items on the toolbar by animating the changes.

## Declaration

```swift
func setItems(_ items: [UIBarButtonItem]?, animated: Bool)
```

## Parameters

- `items`: The items to display on the toolbar.
- `animated`: A Boolean value if set to doc://com.apple.documentation/documentation/Swift/true animates the transition to the items; otherwise, does not.

## Discussion

Discussion If animated is true, the changes are dissolved or the reordering is animated—for example, removed items fade out and new items fade in. This method also adjusts the spacing between items.

## See Also

### Configuring toolbar items

- [items](uikit/uitoolbar/items.md)
