Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i get Tabbar Item Button's Click event by clicking on TabbarItem button?

Tags:

iphone

I have taken UITabbar on that i have used two buttons as TabItem.I want to perform two different Action by clicking on that two button so how can i get particular Action on clicking on particular Tabbar button.

like image 709
Ankit Vyas Avatar asked May 10 '10 08:05

Ankit Vyas


1 Answers

-(void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item
{
    if(item.tag==1)
    {
        //your code
    }
    else
    {
       //your code
    }
}

You can use UITabBarDelegate for keeping the track of which button is pressed by assigning the tag or title for title you can use item.title.

like image 118
Ahsan Avatar answered Sep 27 '22 22:09

Ahsan