MFSideMenu
MFSideMenu copied to clipboard
Unable to switch between view controller and tabbar controllers using MFSideMenu
Hi,
I am pretty new to iOS programming and using MFSideMenu as menu, I was able to get Side menu working with transition between View controllers. In my project i have a use case where i need to switch between view controllers and Tabbar controllers.
I have a SideMenuViewController.m
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath: (NSIndexPath *)indexPath { //Menu icon is clicked from Navigation view controller UINavigationController *navigationController = self.menuContainerViewController.centerViewController;
//I am building tab bar controller with 4 tabs
DefaultViewController *dvc1 = [[DefaultViewController alloc]init];
UINavigationController *nvc1 = [[UINavigationController alloc]initWithRootViewController:dvc1];
DefaultViewController *dvc2 = [[DefaultViewController alloc]init];
UINavigationController *nvc2 = [[UINavigationController alloc]initWithRootViewController:dvc2];
UITabBarController *tabBarController = [[UITabBarController alloc] init];
tabBarController.viewControllers = [NSArray arrayWithObjects:nvc1, nvc2,nil];
//From this point on i am not sure what to do.. how do i tell MFSideMenu to show TabBarcontroller
navigationController.viewControllers = tabBarController.viewControllers;
[self.menuContainerViewController setMenuState:MFSideMenuStateClosed];
}
Appreciate your help.