My app is navigated by a slide out menu from the left. On top of each viewController
is a left UIBarButton
titled "Navigation", that when touched, opens the slide out menu without having to do the drag effect. I am implementing speech commands into my app, and if a user speaks "Go to Finances", it segues to a viewController
titled FianceViewController
through instantiateViewController
to pushViewController
.
This all works fine, the only problem is the back button associated with push segue covers up my "Navigation" button in the left slot of the UINavigationBar
. Using self.navigationItem.hidesBackButton = YES;
hides both the back button and my "Navigation" button. Is there anyway not make a back button appear when the push happens, but still allow my previously created "Navigation" bar button to be seen and used? Or is there another type of segue that I can do other than push
if this UIBarButton
dilemma cannot be solved?
Section of code that segues when spoken:
if ([title isEqualToString:@"FINANCES"])
{
FinanceViewController *fvc = [[self storyboard] instantiateViewControllerWithIdentifier:@"finance"];
[[self navigationController] pushViewController:fvc animated:YES];
}
Instead of hiding my back button, I figured out I could simply write over it! Using fvc.navigationItem.leftBarButtonItem = self.navigationItem.leftBarButtonItem;
before pushViewController
, allows the "navigation" button to override the back button.