I’m currently working on an application that uses a view controller and a tabBar controller. When a tab is selected I’m using webservices to update this particular view. Each tab calls different services to display different types of data.
I use the viewWillAppear method to call methods when the different tabs are selected but what I would like to do is be able to setup some conditionals to only call the method for the current view/tab was selected.
One of my tabs has two views. Based on the view loaded I would like to call the methods in viewWillAppear that relate to the specific view.
How does one find out which tab-view is currently selected and which view has displayed?
Thanks
You can know which tab and View is being selected by Tag id given to each TabBar Item and View in your nib.
There are few questions on SO which can help you indirectly on this problem. One of them is
How to remember last selected tab in UITabBarController?