title: Back Button in SWRevealViewController
body: <p>I use the <code>SWRevealViewController</code> to <em>add a sidebar menu</em> in my app. I have my <code>SideBarViewController</code> where I set the view controller, lets say <code>OptionAViewController</code>. I use the reveal view controller segue to open this new view <code>OptionAViewController</code>. From <code>OptionAViewController</code> I want to implement a back button to return to <code>SideBarViewController</code>. </p>
  
  <p>Here is how I set the <code>optionAViewController</code>. This works.</p>
  
  <pre><code>//SideBarViewController
  
  -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  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 pushViewController:dvc animated: NO ];
          [navController setViewControllers: @[dvc] animated: NO ];
          [self.revealViewController setFrontViewPosition: FrontViewPositionLeft animated: YES];
      };
  }
  </code></pre>
  
  <p>}</p>
  
  <p>And this is how I am trying to implement the back button in <code>OptionAViewController</code>. I tried with <code>popViewController</code> but it crashes. I also tried other options but none of them is working. Do you know what should be the selector?</p>
  
  <pre><code> //back button in ViewDidLoad (OptionAViewController)
  UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
  [button setBackgroundImage:[UIImage imageNamed:@"backButton.png"] forState:UIControlStateNormal];
  [button addTarget:self action:@selector(popViewControllerAnimated:)forControlEvents:UIControlEventTouchUpInside];
  UIBarButtonItem *barButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button];
  self.navigationItem.leftBarButtonItem = barButtonItem;
  </code></pre>