romaonthego / REFrostedViewController

iOS 7/8 style blurred view controller that appears on top of your view controller.
MIT License
2.96k stars 494 forks source link

how to make REFrostedViewController work with UINavigationController? #74

Closed joselufo closed 10 years ago

joselufo commented 10 years ago

I am using REFrostedViewController library to show side bar menu in my project, which has a tableview to show the content.

When the table cell is selected, I want to show a new page. I want to use UINavigationController to push a new view on top. But it seems that there is no UINavigationController stack in REFrostedViewController context.

How can I achieve UINavigationController behavior to work with REFrostedViewController?

romaonthego commented 10 years ago

Not sure what you mean by UINavigationController stack. REFrostedViewController is just a container view controller. You need to reference it from somewhere, for example, store it in a singleton (App Delegate).

swanback commented 10 years ago

Jose, I found code similar to this in Roman's demo and am using it as you describe, when a table cell is selected: MyViewController homeViewController = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:nil]; MyNavViewController navigationController = [[MyNavViewController alloc] initWithRootViewController:homeViewController]; self.frostedViewController.contentViewController = navigationController; [self.frostedViewController hideMenuViewController]; Hope this helps. Roman's work has been very helpful for my project.

acajic commented 10 years ago

@swanback My case:

If I do exactly as you described, and later (on a button press or whatever) I want to do: navigationController.viewControllers = @[someOtherVC];

the app crashes with EXC_BAD_ACCESS error. I cannot figure this out. I opened a separate issue.