MDCTabBarControllerDelegate

@protocol MDCTabBarControllerDelegate <NSObject>

The delegate protocol for MDCTabBarViewController

  • Called when the user taps on a tab bar item. Not called for programmatic selection.

    If you provide this method, you can control whether tapping on a tab bar item actually switches to that viewController. If not provided, MDCTabBarViewController will always switch.

    Note

    The tab bar controller will call this method even when the tapped tab bar item is the currently-selected tab bar item.

    You can also use this method as a willSelectViewController.

    Declaration

    Objective-C

    - (BOOL)tabBarController:(nonnull MDCTabBarViewController *)tabBarController
        shouldSelectViewController:(nonnull UIViewController *)viewController;
  • Called when the user taps on a tab bar item. Not called for programmatic selection. MDCTabBarViewController will call your delegate once it has responded to the user’s tap by changing the selected view controller.

    Note

    The tab bar controller will call this method even when the tapped tab bar item is the currently-selected tab bar item.

    Declaration

    Objective-C

    - (void)tabBarController:(nonnull MDCTabBarViewController *)tabBarController
        didSelectViewController:(nonnull UIViewController *)viewController;