<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UITabBar/setItems(_:animated:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UITabBar(im)setItems:animated:"
  },
  "title" : "setItems(_:animated:)"
}
-->

# setItems(_:animated:)

Sets the items on the tab bar, optionally animating any changes into position.

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

## Parameters

`items`

The array of [`UITabBarItem`](/documentation/UIKit/UITabBarItem) objects to display.

`animated`

A Boolean indicating whether changes should be animated. Specify <doc://com.apple.documentation/documentation/Swift/true> to animate changes or <doc://com.apple.documentation/documentation/Swift/false> to display the new items without animations. When animations are enabled, the tab bar fades out removed items and fades in new items, adjusting the spacing between items as needed.

## Discussion

Use this method to make changes to the currently visible items at runtime. Calling this method on a tab bar that is managed by a [`UITabBarController`](/documentation/UIKit/UITabBarController) object raises an exception. When the tab bar is owned by a tab bar controller, use the tab bar controller’s methods to make changes to items.

---

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)