John-Lluch / SWRevealViewController

A UIViewController subclass for presenting side view controllers inspired on the FaceBook and Wunderlist apps, done right !
Other
4.52k stars 989 forks source link

How to use multiple sw_front in a same Objective-C project Using story board or Programmatically? #802

Open Saravana181187 opened 6 years ago

Saravana181187 commented 6 years ago

In my application I have Implemented two way authentication(i.e) manager login and employee login, If manager login means I want navigate to Viewcontroller1 else employee login means I want to navigate viewcontroller2, Here my question is how to setup the multiple sw_front for two viewcontrollers, I Using Objective-C language for developing. Please can you make some sample for me.

I have tried the following code but it did't worked.. UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; SWRevealViewController *revealController = self.revealViewController; self.view.window.rootViewController = revealController; UIViewController *newFrontController = [sb instantiateViewControllerWithIdentifier:@"clientDetailView"]; UINavigationController *navigationController1 = [[UINavigationController alloc] initWithRootViewController:newFrontController]; [revealController pushFrontViewController:navigationController1 animated:YES];

Please help me for find the issue or provide some sample code.. Thanks..