Reputation: 2307
I am trying to implement AMSlideMenu. My Application flows like this MainVC -> SlideMenuVC -> LoginVC
now in LoginVC if user login button is pressed I want to launch a new VC which should automatically have AMSlideMenu in it. How can I do it ?
VC with Purple Background is the LoginVC
Upvotes: 0
Views: 612
Reputation: 2307
I solved the problem by Explicitly loading a segue like this
[self.mainSlideMenu.leftMenu performSegueWithIdentifier:@"tipsSegue" sender:sender];
Upvotes: 0
Reputation: 7107
Straight from the documentation on github
You can use AMSlideMenu with both static cells and dynamic cell prototypes.
Just follow this steps:
1. Copy AMSlideMenu/AMSlideMenuForStoryboard folder to your project.
2. Make a subclass of AMSlideMenuMainViewController. Assume you made MainVC.h and MainVC.m files (like in this project).
3. Add a UIViewController to your iPhone's or iPad's storyboard and name it's class to MainVC and embed it in UINavigationController
4. For Left Menu:
Add a UITableViewController to your storyboard and name it's class to any class that inherits from
AMSlideMenuLeftTableViewController. Connect the AMSlideMenuMainViewController with your subclass with a custom segue of type AMSlideMenuLeftMenuSegue, set the segue identifier to leftMenu.
For Right Menu:
Add a UITableViewController to your storyboard and name it's class to any class that inherits from
AMSlideMenuRightTableViewController. Connect the AMSlideMenuMainViewController with your subclass with a custom segue of type AMSlideMenuRightMenuSegue, set the segue identifier to rightMenu.
5. To add Content ViewController you have to to do the following:
• Create your content view controller and embed it in a UINavigationController
• Connect it to the AMSlideMenuLeftTableViewController or AMSlideMenuRightTableViewController with custom segue AMSlideMenuContentSegue and set some identifier.
If you want to use dynamic cells , then you have to perform segues in -tableView:didSelectRowAtIndexPath: method yourself.
6.. In MainVC.m override these methods and return segue identifiers that you setted in previous step:
-(NSString *)segueIdentifierForIndexPathInLeftMenu:(NSIndexPath *)indexPath;
-(NSString *)segueIdentifierForIndexPathInRightMenu:(NSIndexPath *)indexPath;
If you want to use multiple storyboards, or just want to use storyboard ids instead of segues, then override these methods:
-(UINavigationController *)navigationControllerForIndexPathInLeftMenu:(NSIndexPath *)indexPath;
-(UINavigationController *)navigationControllerForIndexPathInRightMenu:(NSIndexPath *)indexPath;
Thats it, you are done.
I would check the sample project to get an idea how to approach what you want.
Upvotes: 0