Reputation: 35
I have a sidebar menu, made with SWRevealViewController.
I want to switch from the view controller and the view with the button to the next view controller. How I do that? I try to used the ACTION SEGUE: "push", "modal", "revealview controller" and "revealview controller push controller".
But it doesn't works.
And I try it programmatically switch to the next viewcontroller. MY CODE:
ViewController2 *vc2 = [[ViewController2 alloc] init];
[self.navigationcontroller pushViewController:vc2 animated:YES]
This change the ViewController, but without the view (blackscreen).
Upvotes: 0
Views: 1034
Reputation: 2020
It seems ViewController2 is a ViewController in storyboard. Try the below code:
ViewController2 * vc2 = [[self storyboard] instantiateViewControllerWithIdentifier:@"ViewControllerId"];
You should give Storyboard ID for ViewController2 as ViewControllerId in your storyboard.
Please note that your current ViewController should be in a Navigationcontroller stack to call self.navigationcontroller.
Upvotes: 0