Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find active tab in UITabBarController

I'm working on a radio streaming app with 2 UITabBarController buttons at the bottom of the app. One for Live Streaming and one for Top 40 list.

I'm using a common StreamingViewController for both the tabs. But depending on the tab selected - a different url needs to be passed to the StreamingViewController so that it can play the appropriate feed.

So how can i determine the active tab ?

like image 549
Mohit Avatar asked Feb 26 '11 14:02

Mohit


1 Answers

Did you even look at the documentation? tabBarController.selectedIndex will give you the index of the selected tab, and tabBarController.selectedViewController will give you a pointer to the view controller at the active tab.

like image 87
Ole Begemann Avatar answered Jan 04 '23 01:01

Ole Begemann