Instance Method


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


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



The array of UITabBarItem objects to display.


A Boolean indicating whether changes should be animated. Specify true to animate changes or 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.


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 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.

See Also

Configuring Tab Bar Items

var items: [UITabBarItem]?

The items displayed by the tab bar.

var selectedItem: UITabBarItem?

The currently selected item on the tab bar.