Search code examples
ioseventstabbar

how do I make an event when a tab button is pressed?


I need to fire an event when a tab button has been pressed from the tab bar in Xcode. I am clueless to do this? can someone help me?


Solution

  • You should use UITabBarDelegate to your UITabBar and define tabBar:didSelectItem:

    as described here : How do you connect a tab bar item to an action?