Search code examples
iosobjective-cuinavigationcontrolleruinavigationbaruistoryboardsegue

NavigationController StoryboardSegue not showing navigationBar and navigation delegate not called


I recently changed my app structure to include a UINavigationController as base for my hierarchy and I had its root viewController implement the UINavigationControllerDelegate protocol in order to implement custom segues.

My viewController implements navigationController:animationControllerForOperation:fromViewController:toViewController:.

My problem is two-fold:

  1. The navigationController.delegate methods are not being called.
  2. The navigationBar is not called in the views being pushed via storyboardSegues of type show.

The prepareForSegue:sender: function is being called.

This is my UI:

UI


Solution

  • Turns out that UIStoryboardSegues I added before I added the UINavigationController to my hierarchy are still interpreted as modal segues. Probably this is set during creation.

    The problem was solved by deleting and re-adding the segues in question, with the relevant information (identifier, class...) transferred to the new instance.

    Top bar not shown

    If you have the same problem, when you set Top Par to inferred in your segued viewController you will see no navigationBar showing.

    After replacing the segues the Top Bar showed again as normal.

    Edit:

    I posted the question together with this answer, since there was no post on SO covering this issue. self-answer