How to capture the user click "Tabbar" item action?
I have a applicat开发者_StackOverflowion with many views. For example, I have "A", "B", "C".... Both "A", "B" have a button to switch to "C". Also, I can click the tabbar "C" item to switch to "C". The question is, when I tab the tabbar to switch "C" is different from "B" and "A".
For example, if I click the A view's button, it will switch to "C", and the background color is red. if I click the B view's button, the color will become blue. But when I click on the tabbar, I want to color is yellow. So, I need to know, which class is calling the "C" view to display. What should I do? Thank you.
- Within tab bar item controller you can switch
self.navigationController.tabBarController.selectedIndex
- Within tab bar controller delegate you can send a message to selected view controller by
tabBarController:didSelectViewController
精彩评论