---
title: UITabBar
framework: uikit
role: symbol
role_heading: Class
path: uikit/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.

## Declaration

```swift
@MainActor class UITabBar
```

## Overview

Overview Typically, you use tab bars in conjunction with a 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 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 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:) 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 UITabBar class and 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 object acts as the delegate for the tab bar it manages.) For more information on implementing a tab bar delegate, see 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 object: Configuring your tab bar in Interface Builder: When a 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 object, configure the view controllers associated with the tab bar controller. The tab bar automatically obtains its items from the tabBarItem property of each view controller associated with the tab bar controller. To configure tab bar items directly, use the setItems(_:animated:) method of the tab bar itself. A tab bar displays all of its tabs onscreen at once, using the itemPositioning 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(_:) method displays an interface for selecting which tab bar items to display. The contents of each item are stored in a 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. 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:) method of its delegate object, which you can use to respond to selection changes. For more information about implementing the delegate object, see UITabBarDelegate. Configure a tab bar with Interface Builder The following table lists the attributes that you configure for tab bars in Interface Builder.  |   |   |   |   |   |   |   |  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. For design guidance, see Human Interface Guidelines.

## Topics

### Customizing the tab bar behavior

- [delegate](uikit/uitabbar/delegate.md)
- [UITabBarDelegate](uikit/uitabbardelegate.md)

### Configuring tab bar items

- [items](uikit/uitabbar/items.md)
- [setItems(_:animated:)](uikit/uitabbar/setitems(_:animated:).md)
- [selectedItem](uikit/uitabbar/selecteditem.md)

### Customizing tab bar appearance

- [standardAppearance](uikit/uitabbar/standardappearance.md)
- [scrollEdgeAppearance](uikit/uitabbar/scrolledgeappearance.md)
- [leadingAccessoryView](uikit/uitabbar/leadingaccessoryview.md)
- [trailingAccessoryView](uikit/uitabbar/trailingaccessoryview.md)
- [isTranslucent](uikit/uitabbar/istranslucent.md)
- [Legacy customizations](uikit/uitabbar-legacy-customizations.md)

### Supporting user customization of tab bars

- [beginCustomizingItems(_:)](uikit/uitabbar/begincustomizingitems(_:).md)
- [endCustomizing(animated:)](uikit/uitabbar/endcustomizing(animated:).md)
- [isCustomizing](uikit/uitabbar/iscustomizing.md)

## Relationships

### Inherits From

- [UIView](uikit/uiview.md)

### Conforms To

- [CALayerDelegate](quartzcore/calayerdelegate.md)
- [CLBodyIdentifiable](corelocation/clbodyidentifiable.md)
- [CMBodyIdentifiable](coremotion/cmbodyidentifiable.md)
- [CVarArg](swift/cvararg.md)
- [Copyable](swift/copyable.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSTouchBarProvider](appkit/nstouchbarprovider.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [UIAccessibilityIdentification](uikit/uiaccessibilityidentification.md)
- [UIActivityItemsConfigurationProviding](uikit/uiactivityitemsconfigurationproviding.md)
- [UIAppearance](uikit/uiappearance.md)
- [UIAppearanceContainer](uikit/uiappearancecontainer.md)
- [UICoordinateSpace](uikit/uicoordinatespace.md)
- [UIDynamicItem](uikit/uidynamicitem.md)
- [UIFocusEnvironment](uikit/uifocusenvironment.md)
- [UIFocusItem](uikit/uifocusitem.md)
- [UIFocusItemContainer](uikit/uifocusitemcontainer.md)
- [UILargeContentViewerItem](uikit/uilargecontentvieweritem.md)
- [UIPasteConfigurationSupporting](uikit/uipasteconfigurationsupporting.md)
- [UIPopoverPresentationControllerSourceItem](uikit/uipopoverpresentationcontrollersourceitem.md)
- [UIResponderStandardEditActions](uikit/uiresponderstandardeditactions.md)
- [UISpringLoadedInteractionSupporting](uikit/uispringloadedinteractionsupporting.md)
- [UITraitChangeObservable](uikit/uitraitchangeobservable-67e94.md)
- [UITraitEnvironment](uikit/uitraitenvironment.md)
- [UIUserActivityRestoring](uikit/uiuseractivityrestoring.md)

## See Also

### Container view controllers

- [Creating a custom container view controller](uikit/creating-a-custom-container-view-controller.md)
- [UISplitViewController](uikit/uisplitviewcontroller.md)
- [UINavigationController](uikit/uinavigationcontroller.md)
- [UINavigationBar](uikit/uinavigationbar.md)
- [UINavigationItem](uikit/uinavigationitem.md)
- [UITabBarController](uikit/uitabbarcontroller.md)
- [UITabBarItem](uikit/uitabbaritem.md)
- [UITab](uikit/uitab.md)
- [UITabAccessory](uikit/uitabaccessory.md)
- [UISearchTab](uikit/uisearchtab.md)
- [UITabGroup](uikit/uitabgroup.md)
- [UIPageViewController](uikit/uipageviewcontroller.md)
