UITabBarDelegate Protocol Reference

Conforms to
Framework
/System/Library/Frameworks/UIKit.framework
Availability
Available in iOS 2.0 and later.
Companion guide
Declared in
UITabBar.h
Related sample code

Overview

The UITabBarDelegate protocol defines optional methods for a delegate of a UITabBar object. The 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.

Send beginCustomizingItems: to a UITabBar object to begin customizing. Implement the methods in “Customizing Tab Bars” to intervene while a user is customizing a tab bar. The customizing modal view is dismissed when the user taps the Done button on the modal view.

Tasks

Customizing Tab Bars

Instance Methods

tabBar:didBeginCustomizingItems:

Sent to the delegate after the customizing modal view is displayed.

- (void)tabBar:(UITabBar *)tabBar didBeginCustomizingItems:(NSArray *)items
Parameters
tabBar

The tab bar that is being customized.

items

The items on the customizing modal view.

Availability
  • Available in iOS 2.0 and later.
Declared In
UITabBar.h

tabBar:didEndCustomizingItems:changed:

Sent to the delegate after the customizing modal view is dismissed.

- (void)tabBar:(UITabBar *)tabBar didEndCustomizingItems:(NSArray *)items changed:(BOOL)changed
Parameters
tabBar

The tab bar that is being customized.

items

The items on the customizing modal view.

changed

YES if the visible set of items on the tab bar changed; otherwise, NO.

Availability
  • Available in iOS 2.0 and later.
Declared In
UITabBar.h

tabBar:didSelectItem:

Sent to the delegate when the user selects a tab bar item. (required)

- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item
Parameters
tabBar

The tab bar that is being customized.

item

The tab bar item that was selected.

Availability
  • Available in iOS 2.0 and later.
Declared In
UITabBar.h

tabBar:willBeginCustomizingItems:

Sent to the delegate before the customizing modal view is displayed.

- (void)tabBar:(UITabBar *)tabBar willBeginCustomizingItems:(NSArray *)items
Parameters
tabBar

The tab bar that is being customized.

items

The items on the customizing modal view.

Discussion

Use the beginCustomizingItems: method of UITabBar to display the customizing modal view and begin the customizing mode.

Availability
  • Available in iOS 2.0 and later.
Declared In
UITabBar.h

tabBar:willEndCustomizingItems:changed:

Sent to the delegate before the customizing modal view is dismissed.

- (void)tabBar:(UITabBar *)tabBar willEndCustomizingItems:(NSArray *)items changed:(BOOL)changed
Parameters
tabBar

The tab bar that is being customized.

items

The items on the customizing modal view.

changed

YES if the visible set of items on the tab bar changed; otherwise, NO.

Availability
  • Available in iOS 2.0 and later.
Declared In
UITabBar.h