2

I want to build a Slide out Navigation panel for both side (left & right) with segue. Some of the things i have to follow in this case. The left & right side menu table must be in UIViewController (not in UITableViewController) & all of the viewController is navigate through UINavigationController (Embedded).

I already try a ton of examples, But all of them are done by UITableViewController. Because of that i can't customize my left or right side Menu table according to my design.

If any one can give me some reference or similar tutorials, that would be very appreciable.

Thanks a lot in advanced. Have a good day.

Mayur Prajapati
  • 5,454
  • 7
  • 41
  • 70
Tulon
  • 4,011
  • 6
  • 36
  • 56

2 Answers2

5

you can use MMDrawcontroller and Pass LeftView, RightView and Centerview with Navigationcontroller. All three controllers are UIViewController. You can also add Left and Right View with NavigationController same as CenterView so you can push from left and right view.

CenterVC *objCenter = [[CenterVC alloc] initWithNibName:@"CenterVC" bundle:nil];
LeftVC *objleftVC = [[LeftVC alloc] initWithNibName:@"LeftVC" bundle:nil];
RightVC *objrightVC = [[RightVC alloc] initWithNibName:@"RightVC" bundle:nil];

/*--- Init navigation for Center Controller ---*/
UINavigationController *_navC = [[UINavigationController alloc] initWithRootViewController:objCenter];
_navC.navigationBarHidden = YES;
_navC.navigationBar.translucent = NO;
MMDrawerController *drawerController = [[MMDrawerController alloc]
                                        initWithCenterViewController:_navC
                                        leftDrawerViewController:objleftVC
                                        rightDrawerViewController:objrightVC];
[drawerController setShowsShadow:NO];
[drawerController setRestorationIdentifier:@"MMDrawer"];
[drawerController setMaximumLeftDrawerWidth:[[UIScreen mainScreen] bounds].size.width-45.0];
[drawerController setMaximumRightDrawerWidth:[[UIScreen mainScreen] bounds].size.width-45.0];
[drawerController setOpenDrawerGestureModeMask:MMOpenDrawerGestureModeAll];
[drawerController setCloseDrawerGestureModeMask:MMCloseDrawerGestureModeAll];
[drawerController setShouldStretchDrawer:NO];

[drawerController
 setDrawerVisualStateBlock:^(MMDrawerController *drawerController, MMDrawerSide drawerSide, CGFloat percentVisible) {
     MMDrawerControllerDrawerVisualStateBlock block;
     block = [[MMExampleDrawerVisualStateManager sharedManager]
              drawerVisualStateBlockForDrawerSide:drawerSide];
     if(block){
         block(drawerController, drawerSide, percentVisible);
     }
 }];


[self.navigationController pushViewController:drawerController animated:isAnimate];

Using Storyboard download (https://github.com/TomSwift/MMDrawerController-Storyboard) . Add MMDrawerController+Storyboard and then Replace or check Storyboard which was used in above demo and add code in AppDelegate as per demo.

So your demo project will look like below image

enter image description here

ChintaN -Maddy- Ramani
  • 5,156
  • 1
  • 27
  • 48
  • Thanks for your comment. But the zip file I download from here, it doesn't have any storyboard file. :( I am a little bit slow. Hope you don't mind. :) – Tulon Feb 09 '15 at 11:13
  • 1
    @Tulon try this (https://github.com/TomSwift/MMDrawerController-Storyboard) maybe this will help you. – ChintaN -Maddy- Ramani Feb 09 '15 at 11:19
  • Thanks a lot. It seems to me great but the git you provide me last I can't make it run on my device. Because of `clang: error: linker command failed with exit code 1 (use -v to see invocation)` error. – Tulon Feb 09 '15 at 11:54
  • @Tulon Create new project. Replace default storyboard with `MainStoryboard_iPhone`. add MMDraw Classes or POD. and add code in AppDelegate. also add `MMDrawerController+Storyboard` – ChintaN -Maddy- Ramani Feb 09 '15 at 12:32
  • I didn't see any `MMDrawerController+Storyboard` here. `MMDraw classes` >> you mean `MMDrawerController`?? Do you have any sample doc about this? I think this is the only one I can use in my project. Thanks a lot Ramani – Tulon Feb 09 '15 at 12:51
  • @Tulon you can get that file from (https://github.com/TomSwift/MMDrawerController-Storyboard) – ChintaN -Maddy- Ramani Feb 09 '15 at 12:53
  • Yes, I am got it earlier. But it has a clag error. THe pod isn't updated I presume. :( – Tulon Feb 09 '15 at 12:58
  • @Tulon Thats why i told you create new project and add that file into your new project. **do not use pod** for `MMDrawerController+Storyboard` just add that file into your project. Do not use POD. take all files and add it manually. – ChintaN -Maddy- Ramani Feb 09 '15 at 13:00
  • In main project, there are `MMDrawerController+Storyboard` files and a folder named `KitchenSinkStoryboard` exist. In that folder I have `ExampleFiles` and `icons`. MMDrawerController and all the above files I included into my newly created project. And the story board is replaced by the sample's one MainStoryboard_iPhone. But unfortunately it is showing clang error just like the original. Just wondering It would be better if they provide some video tutorial or details instruction to embedded in project. I am not very familiar using pod. Thanks a lot man. – Tulon Feb 09 '15 at 13:08
  • @Tulon I've done that and i didn't get any error. Get all MMDrawer files from (https://github.com/mutualmobile/MMDrawerController). thats why i told you do not use POD. just select all files and add it into your project. – ChintaN -Maddy- Ramani Feb 09 '15 at 13:11
  • Ok. Can you give me full instruction step by step? I am waiting. :) Right now I have a new created project. Now, there are two git you are talking about. One the original source and another is the error with clang. What should I follow. – Tulon Feb 09 '15 at 13:13
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/70568/discussion-between-chintan-maddy-ramani-and-tulon). – ChintaN -Maddy- Ramani Feb 09 '15 at 13:14
1

Try SWRevealViewController. I think this might meet all your requirements. Its well documented so there's no need to say much here.

ShahiM
  • 3,179
  • 1
  • 33
  • 58
  • I already try with that. It only has "RevealControllerStoryboardExample2" for Storyboard, where they work with only left Menu side with `UITableViewController`. But I need left & right side menu and the tableView will embedded on `UIViewController`. – Tulon Feb 09 '15 at 12:32
  • 1
    have a look at this thread - http://stackoverflow.com/questions/24517100/swrevealviewcontroller-rightviewcontroller – ShahiM Feb 09 '15 at 12:50