I have this code
PlaceViewController *newView = [self.storyboard instantiateViewControllerWithIdentifier:@"PlaceView"];
[self presentViewController:newView animated:YES completion:nil];
And I can change view, but I would push this view for when I return at this page, the state persists.
I try to put this code:
[self.navigationController pushViewController:newView animated:YES];
but doesn't do anything.
Thanks
Check 2 things,
your storyboard identifier is correct.
The root view have navigation Controller.
Swift 3.x
Use:
Or:
For Storyboards, you should use
performSegueWithIdentifier
like so:By default, Xcode creates a standard view controller. we first change the view controller to navigation controller. Select the Simply select “Editor” in the menu and select “Embed in”, followed by “Navigation Controller” Step 1. Select Main story board Step 2.Click on "Editor" on top of your Xcode application. Step 3. Click on "Embed In"
Xcode automatically embeds the View Controller with Navigation Controller.