Hello,
I am trying to create my own implementation of a tab bar, using a toolbar instead of a tabbar (to enable customization of the new "tab bar"). In order to achieve this, I need to have the ability to switch between views when a button is pressed.
Currently, my view consists of a tabBar subview, and a customView subview. The latter needs to be switched in the button callback of newTabBarController. Can anyone tell me how I might do this? Essentially I am wanting the same effect as presentModalViewController for the subview. Simply setting my view pointer to a different view doesn't work.
Here is some example code:
- (void)viewDidLoad{
customView = selectedViewController.view;
[self.view addSubView:customView];
[self.view addSubView:newTabBarController.view];
}
- (void)buttonHandler:(id)sender {
NewViewController newController = [[NewViewController alloc] init];
// what to do now??
}
To be clear: the newTabBarController does not inherit from UITabBarController. It subclasses UIViewController.