0

I have storyboard structure with SWRevealViewController. Everything works fine, setting view controllers etc. Now, I have one image on menu that leads to profile and is not in structure of SWReveal. Anybody knows any way of pushing it to root navigation controller and back button to lead back to SWReveal?

I have tried this:

RegistrationvViewController *vcSw = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"editProfile"];
[self presentViewController:vcSw animated:YES completion:nil];

I embedded SWReveal in NavigationController and tried performingSegueWithIdentifier but back is not shown as well.

Stefan
  • 1,283
  • 15
  • 33

1 Answers1

0

//if you want to push from swreveal to any controller so you have to make a navigation controller

use this code

 UIStoryboard*Storyboard=[AppDelegate storyBoardType];
            yourController  *dashboard=(yourController*)[Storyboard instantiateViewControllerWithIdentifier:@"yourControllerId"];

            UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:dashboard];

            [navController setViewControllers: @[yourController] animated: YES];
            [self.revealViewController setFrontViewController:navController];
            [self.revealViewController setFrontViewPosition: FrontViewPositionLeft animated: YES]; 

//back to the swreveal from controller

[self.revealViewController revealToggleAnimated:YES];
Dishant Rajput
  • 1,329
  • 1
  • 10
  • 20