Search code examples
iosobjective-cecslidingviewcontrollerecslidingviewcontroller-2

Can I have two ECSlidingViewController Drawer from left and right?


I want to have two Drawer menus, one from left another from the right. Is it possible using ECSlidingViewController 2. If no then can you suggest the better way to achieve the same?


Solution

  • Check out this library RESideMenu is it very easy and have left and right menus

    Here is a sample code

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
        UIViewController *firstViewController;// initial view controller
        UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:firstViewController]];
        UIViewController *leftMenuViewController; // your left menu
        UIViewController *rightMenuViewController; // your right menu
        RESideMenu *sideMenuViewController = [[RESideMenu alloc] initWithContentViewController:navigationController
                                                                        leftMenuViewController:leftMenuViewController
                                                                       rightMenuViewController:rightMenuViewController];
    
        sideMenuViewController.backgroundImage = [UIImage imageNamed:@"Stars"];
        [self.window makeKeyAndVisible];
        return YES;
    }