How do I switch Front View Controller using PKRevealController?
objective-c, uigesturerecognizer, uinavigationcontroller, uiview, uiviewcontroller
Solution
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if (tableView == leftMenu) {
// Load new front view
UIViewController *myNewUIViewController = [[MyNewUIViewController alloc] initWithNibName:@"MyNewUIViewController" bundle:nil];
UINavigationController *myNavController = [[UINavigationController alloc] initWithRootViewController:myNewUIViewController];
[self.revealController setFrontViewController:myNavController];
// Putting back the front view on focus
[self.revealController showViewController:self.revealController.frontViewController];
}
}
Problem
I am working with PKRevealController in a new app project, you can get it here: https://github.com/pkluz/PKRevealController The issue I am having is changing the view properly that displays in the Front View Controller. For example, I swipe the front view to the left or right and have a list of options, one could be Settings for example. If I tap that I would like the Front View Controller to slide back in place and display the view for the Settings View Controller. I can get a new view to show up, but it removes the Navigation Controller and messes up the size of the view. Has anyone successfully figured out how to do this with PKRevealController? Any tips or advice is much appreciated!