9

I am currently doing a project (an update) I have to add a sidebar in it. the project is now currently done without using navigation controller. Can I use SWRevealViewController in it without using NavigationController. Please help me. Any sample codes are helpful.

In the sample codes i saw the navigation is done using navigationController which the project doesn't have.

Thank you

UPDATE:

Transition code. How can I manage this using storyboard ID.

if ( [segue isKindOfClass: [SWRevealViewControllerSegue class]] ) {
    SWRevealViewControllerSegue *swSegue = (SWRevealViewControllerSegue*) segue;

    swSegue.performBlock = ^(SWRevealViewControllerSegue* rvc_segue, UIViewController* svc, UIViewController* dvc) {

        UINavigationController* navController = (UINavigationController*)self.revealViewController.frontViewController;
        [navController setViewControllers: @[dvc] animated: NO ];
        [self.revealViewController setFrontViewPosition: FrontViewPositionLeft animated: YES];
    };
Anbu.Karthik
  • 82,064
  • 23
  • 174
  • 143
Abin George
  • 644
  • 6
  • 21

1 Answers1

3

enter image description here

where you need to push or model new view controller call the below code

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"yourstoryboardname" bundle: nil];

  UIViewController *viewController = [storyboard instantiateViewControllerWithIdentifier:@"yourIDName"];


[[self navigationController] pushViewController:viewController animated:NO];
Anbu.Karthik
  • 82,064
  • 23
  • 174
  • 143
  • Hi Anbu! I saw your active participation in many questions related to SWRevealViewController. I need some help with [this question](http://stackoverflow.com/questions/24517100/swrevealviewcontroller-rightviewcontroller). Thanks! – LoveMeSomeFood Jul 02 '14 at 15:49