Search code examples
uinavigationitem

UINavigationItem Prompt Animation Issue


I have two UITableViewControllers that are connected via a Show segue. The prompt property of UINavigationItem is set on both view controllers in Interface Builder. When the first view controller is shown, the prompt and navigation bar are both displayed properly, however, when performing a segue to the second view controller, the title and the back button animate undesirably. I have tried setting the prompts programmatically in the viewWillLayoutSubviews, viewDidLayoutSubviews, viewDidLoad, viewWillAppear:, and the viewDidAppear: methods of both view controllers, but I get the same effect.

Any ideas on how to resolve this issue? I don't want to resort to a custom view for the titleView because I prefer the stock functionality, but I am not able to figure out how to fix the undesirable animation.

Here is a video if the animation in question.


Solution

  • Well, it looks like this is an issue with the way that the UINavigationItem is laid out when showing the next view controller.

    According to Catalina T. in an answer to a similar question, making two calls to set the hidden property of the navigation bar to true and then again to false in viewWillAppear: seems to get by this issue.