Created
August 19, 2013 05:45
-
-
Save markSci5/6266019 to your computer and use it in GitHub Desktop.
Manual tab switching
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Custom tab bar implementation from http://www.wiredbob.com/2009/04/iphone-tweetie-style//-navigation.html | |
- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item | |
{ | |
if (item == favouritesTabBarItem) { | |
UIViewController *fabViewController = [viewControllers objectAtIndex:0]; | |
[self.selectedViewController.view removeFromSuperview]; | |
[self.view addSubview:fabViewController.view]; | |
self.selectedViewController = fabViewController; | |
} else if (item == moreTabBarItem) { | |
UIViewController *moreViewController = [viewControllers objectAtIndex:1]; | |
[self.selectedViewController.view removeFromSuperview]; | |
[self.view addSubview:moreViewController.view]; | |
self.selectedViewController = moreViewController; | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment