<!--
{
  "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",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UITabBar"
  },
  "title" : "UITabBar"
}
-->

# UITabBar

A control that displays one or more buttons in a tab bar for selecting between different subtasks, views, or modes in an app.

```
@MainActor class UITabBar
```

## Overview

Typically, you use tab bars in conjunction with a [`UITabBarController`](/documentation/UIKit/UITabBarController) object, but you can also use them as standalone controls in your app. Tab bars always appear across the bottom edge of the screen and display the contents of one or more [`UITabBarItem`](/documentation/UIKit/UITabBarItem) objects. A tab bar’s appearance can be customized with a background image or tint color to suit the needs of your interface. Tapping an item selects and highlights that item, and you use the selection of the item to enable the corresponding mode for your app.

You can configure tab bars programmatically or in Interface Builder. A [`UITabBarController`](/documentation/UIKit/UITabBarController) object provides its own tab bar object and you must configure the object provided to you. When creating a tab bar programmatically, use the [`init(frame:)`](/documentation/UIKit/UIView/init(frame:)) method or another view initializer method to set its initial configuration. Use the methods of this class to configure the appearance of the tab bar. For tab bars you create yourself, you also use the methods of this class to specify the items displayed by the tab bar.

> Note:
> The ``doc://com.apple.uikit/documentation/UIKit/UITabBar`` class and ``doc://com.apple.uikit/documentation/UIKit/UIToolbar`` classes have similar appearances but different purposes. Use tab bars to convey and change your app’s mode. Use toolbars to present the user with a set of actions that are relevant to the currently presented content.

A tab bar reports selections and user customizations to its delegate object. For tab bars you create yourself, use the delegate to respond to selections or to the addition, removal, or reordering of items in the tab bar. (A [`UITabBarController`](/documentation/UIKit/UITabBarController) object acts as the delegate for the tab bar it manages.) For more information on implementing a tab bar delegate, see [`UITabBarDelegate`](/documentation/UIKit/UITabBarDelegate).

### Configure the tab bar items

You can configure tab bar items using Interface Builder or create and configure them programmatically in your code. Tab bars in Interface Builder come preconfigured with some initial items and you can add, remove, or reorder items as needed. How you configure items at design time depends on whether your tab bar is associated with a [`UITabBarController`](/documentation/UIKit/UITabBarController) object:

- Configuring your tab bar in Interface Builder:
- When a [`UITabBarController`](/documentation/UIKit/UITabBarController) object is present, add or remove view controllers to your scene and create relationship segues between the tab bar controller and each new view controller. Creating a relationship segue automatically adds a new item to the tab bar, and deleting an existing relationship segue removes the corresponding tab bar item.
- When a tab bar controller isn’t present, drag tab bar items from the library onto your tab bar.
- Configuring your tab bar programmatically:
- To configure the tab bar associated with a [`UITabBarController`](/documentation/UIKit/UITabBarController) object, configure the view controllers associated with the tab bar controller. The tab bar automatically obtains its items from the [`tabBarItem`](/documentation/UIKit/UIViewController/tabBarItem) property of each view controller associated with the tab bar controller.
- To configure tab bar items directly, use the [`setItems(_:animated:)`](/documentation/UIKit/UITabBar/setItems(_:animated:)) method of the tab bar itself.

A tab bar displays all of its tabs onscreen at once, using the [`itemPositioning`](/documentation/UIKit/UITabBar/itemPositioning-swift.property) property to determine how to position items in the available space. If you have more items than can fit in the available space, display only a subset of them and let the user select which tabs are displayed. The [`beginCustomizingItems(_:)`](/documentation/UIKit/UITabBar/beginCustomizingItems(_:)) method displays an interface for selecting which tab bar items to display.

The contents of each item are stored in a [`UITabBarItem`](/documentation/UIKit/UITabBarItem) object. Each item contains a title and an image to display in the tab. You can also use tab bar items to add a badge to the corresponding tab. For more information about creating and configuring items, see [`UITabBarItem`](/documentation/UIKit/UITabBarItem).

### Respond to tab selections

For tab bars with an associated tab bar controller, the tab bar controller automatically manages selections and displays the appropriate view controller. The only time you have to manage selections yourself is when you create the tab bar without a tab bar controller. The tab bar reports selections to the [`tabBar(_:didSelect:)`](/documentation/UIKit/UITabBarDelegate/tabBar(_:didSelect:)) method of its [`delegate`](/documentation/UIKit/UITabBar/delegate) object, which you can use to respond to selection changes. For more information about implementing the delegate object, see [`UITabBarDelegate`](/documentation/UIKit/UITabBarDelegate).

### Configure a tab bar with Interface Builder

The following table lists the attributes that you configure for tab bars in Interface Builder.

|Attribute       |Discussion                                                                                                                                                                                                                                                                                                                                                                                |
|----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|Background      |The background image to display for the bar. If you specify a stretchable image, the image is stretched to fit the available space; otherwise, the image is tiled. When you configure a background image, the tab bar ignores the tint color information. To set this attribute programmatically, use the ``doc://com.apple.uikit/documentation/UIKit/UITabBar/backgroundImage`` property.|
|Shadow          |The custom shadow image for the tab bar. This attribute is ignored if the tab bar does not also have a custom background image. To set this attribute programmatically, use the ``doc://com.apple.uikit/documentation/UIKit/UITabBar/shadowImage`` property.                                                                                                                              |
|Selection       |The image to use for the selected tab. To set this attribute programmatically, use the ``doc://com.apple.uikit/documentation/UIKit/UITabBar/selectionIndicatorImage`` property.                                                                                                                                                                                                           |
|Image Tint      |The tint color to apply to the selected item. To set this attribute programmatically, use the ``doc://com.apple.uikit/documentation/UIKit/UITabBar/tintColor`` property.                                                                                                                                                                                                                  |
|Style           |The basic style to apply to the bar. You can configure a tab bar with a dark or light style and the bar can be opaque or translucent. To set the style programmatically, use the ``doc://com.apple.uikit/documentation/UIKit/UITabBar/barStyle`` and ``doc://com.apple.uikit/documentation/UIKit/UITabBar/isTranslucent`` properties.                                                     |
|Bar Tint        |The tint color to apply to the bar. To set this attribute programmatically, use the ``doc://com.apple.uikit/documentation/UIKit/UITabBar/barTintColor`` property.                                                                                                                                                                                                                         |
|Item Positioning|The positioning scheme to apply to items. Use this attribute to configure how items are spaced across the length of the tab bar. To set this attribute programmatically, use the ``doc://com.apple.uikit/documentation/UIKit/UITabBar/itemPositioning-swift.property`` property.                                                                                                          |

### Internationalize a tab bar

To internationalize a tab bar, you must provide localized strings for the tab bar item titles.

For more information, see `Localization`.

### Make a tab bar accessible

Tab bars are accessible by default.

With VoiceOver enabled on an iOS device, when a user touches a tab in a tab bar, VoiceOver reads the title of the tab, its position in the bar, and whether it’s selected. For example in the iTunes app on iPad, you might hear “Selected, Audiobooks, four of seven” or “Genius, six of seven.”

For general information about making your interface accessible, see [Accessibility for UIKit](/documentation/UIKit/accessibility-for-uikit).

For design guidance, see [Human Interface Guidelines](https://developer.apple.com/design/human-interface-guidelines/components/navigation-and-search/tab-bars).

## Topics

### Customizing the tab bar behavior

[`delegate`](/documentation/UIKit/UITabBar/delegate)

The tab bar’s delegate object.

[`UITabBarDelegate`](/documentation/UIKit/UITabBarDelegate)

The [`UITabBarDelegate`](/documentation/UIKit/UITabBarDelegate) protocol defines optional methods for a delegate of a [`UITabBar`](/documentation/UIKit/UITabBar) object. The [`UITabBar`](/documentation/UIKit/UITabBar) class provides the ability for the user to reorder, remove, and add items to the tab bar; this process is referred to as customizing the tab bar. The tab bar delegate receives messages when customizing occurs.

### Configuring tab bar items

[`items`](/documentation/UIKit/UITabBar/items)

The items displayed by the tab bar.

[`setItems(_:animated:)`](/documentation/UIKit/UITabBar/setItems(_:animated:))

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

[`selectedItem`](/documentation/UIKit/UITabBar/selectedItem)

The currently selected item on the tab bar.

### Customizing tab bar appearance

[`standardAppearance`](/documentation/UIKit/UITabBar/standardAppearance)

The appearance settings for a standard-height tab bar.

[`scrollEdgeAppearance`](/documentation/UIKit/UITabBar/scrollEdgeAppearance)

The appearance settings for the tab bar when the edge of scrollable content aligns with the edge of the tab bar.

[`leadingAccessoryView`](/documentation/UIKit/UITabBar/leadingAccessoryView)

The view at the leading edge of a tab bar on tvOS.

[`trailingAccessoryView`](/documentation/UIKit/UITabBar/trailingAccessoryView)

The view at the trailing edge of a tab bar on tvOS.

[`isTranslucent`](/documentation/UIKit/UITabBar/isTranslucent)

A Boolean value that indicates whether the tab bar is translucent.

[Legacy customizations](/documentation/UIKit/uitabbar-legacy-customizations)

Customize appearance information directly on the tab bar object.

### Supporting user customization of tab bars

[`beginCustomizingItems(_:)`](/documentation/UIKit/UITabBar/beginCustomizingItems(_:))

Presents a standard interface that lets the user customize the contents of the tab bar.

[`endCustomizing(animated:)`](/documentation/UIKit/UITabBar/endCustomizing(animated:))

Dismisses the standard interface used to customize the tab bar.

[`isCustomizing`](/documentation/UIKit/UITabBar/isCustomizing)

A Boolean value indicating whether the user is currently customizing the tab bar.



---

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)