MDCTabBarDelegate

@protocol MDCTabBarDelegate <UIBarPositioningDelegate>

Delegate protocol for MDCTabBar. Clients may implement this protocol to receive notifications of selection changes in the tab bar or to determine the bar’s position.

  • Called before the selected item changes by user action. This method is not called for programmatic changes to the tab bar’s selected item. Return YES to allow the selection. If you don’t implement all items changes are allowed.

    Declaration

    Objective-C

    - (BOOL)tabBar:(nonnull MDCTabBar *)tabBar
        shouldSelectItem:(nonnull UITabBarItem *)item;
  • Called before the selected item changes by user action. This method is not called for programmatic changes to the tab bar’s selected item. NOTE: Will be deprecated. Use tabBar:shouldSelectItem:.

    Declaration

    Objective-C

    - (void)tabBar:(nonnull MDCTabBar *)tabBar
        willSelectItem:(nonnull UITabBarItem *)item;
  • Called when the selected item changes by user action. This method is not called for programmatic changes to the tab bar’s selected item.

    Declaration

    Objective-C

    - (void)tabBar:(nonnull MDCTabBar *)tabBar
        didSelectItem:(nonnull UITabBarItem *)item;