Reputation: 2026
I have a push segue between one view controller and another. When the selects a certain option from an action sheet, the segue is performed and the view appears. I created the segue as per this answer.
On iOS 8, this works fine. The view is added to the navigation controller and a back button appears automatically. On iOS 7 however, I've just noticed that the view appears as a modal and doesn't show the Navigation Bar at all. I don't know when this started happening, but I can't seem to figure out why.
When the action sheet item is pressed, I use:
[self performSegueWithIdentifier:@"showRouteInformationFromMap" sender:nil];
to call the segue. I prepare the segue using:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([[segue identifier] isEqualToString:@"showRouteInformationFromMap"]) {
[[segue destinationViewController] setRouteInfo:selectedRouteID];
}
}
Which just assigns a value on the destination controller. I don't make any changes to the Navigation Bar on either view controller.
Upvotes: 3
Views: 2457
Reputation: 339
Try to remove your segue in storyboard and create a segue again. This approach worked for me in iOS 10.
Upvotes: 3
Reputation: 887
2 workarounds are there.
the show segue is introduced in iOS 8 and hence the unexpected behavior in 7 is very much expected.
1st workaround: push your controller manually
UIViewController *myController = [self.storyBoard.instantiateViewControllerWithIdentifier:@"storyboardIdentifier"];
self.navigationController pushViewController:myController animated:YES];
2nd workaround: Using storyboard
disconnect the show segue and connect the push segue (displayed as deprecated).
Upvotes: 2