I have created a UITabBar and UITabBarItems without UITabBarController on it, now i want to know how to place an action on click of the UITabBarItem.What is the method i should use for action on UITabBarItem?
You can't set an action on a UITabBarItem
object directly. Instead, your view controller should implement the following UITabBarDelegate
method:
- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item;
This method is called when the user selects a tab (i.e. UITabBarItem
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With