Closed BetterCallJohn closed 12 years ago
The library wasn't created for use with a UITabBarController. Feel free to fork it and create a version that is compatible.
MFSideMenu is designed to work off of one UINavigationController. Your UITabBarController has multiple UINavigationControllers, and that's why the library wouldn't work with more than one tab.
I pushed a large update to the MFSideMenu project today and it now supports UITabBarController-based apps. Download the sample project for an example of how to implement it.
If I use UITabBar and UINavigationController programmatically there is an issue with MFSideBarMenu.
The sideMenuController doesn't appear if there are more than one TabBarItem.
Code :
(BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.tabBarController = [[UITabBarController alloc] init]; NSMutableArray *tabs = [[NSMutableArray alloc] init];
HomeViewController homeViewController = [[HomeViewController alloc] init]; [homeViewController setTitle:@"First"]; UINavigationController homeNavigationController = [[UINavigationController alloc] initWithRootViewController:homeViewController]; [tabs addObject:homeNavigationController];
CatalogViewController mySecondViewController = [[CatalogViewController alloc] init]; [mySecondViewController setTitle:@"Second"]; UINavigationController secondNavigationController = [[UINavigationController alloc] initWithRootViewController:mySecondViewController]; [tabs addObject:secondNavigationController];
[self.tabBarController setViewControllers:tabs];
[self.window setRootViewController:self.tabBarController];
[self.window makeKeyAndVisible];
SidebarViewController *sideMenuViewController = [[SidebarViewController alloc] init];
MenuOptions options = MenuButtonEnabled|BackButtonEnabled; [MFSideMenuManager configureWithNavigationController:homeNavigationController sideMenuController:sideMenuViewController menuSide:MenuLeftHandSide options:options]; return YES; }
Any solutions ?
Thanks