Howdy,
I have a storyboard-based view controller which I manually load into memory (i.e. no segues) and push into a navigation stack. For this view controller, I would like to dynamically update the title prior to presentation based on some runtime-state.
My initial assumption was that this could be done simply by updating navigationItem.title
sometime before viewDidAppear(:)
. But this procedure is not behaiving quite as I expected. It seems that no matter where I set navigationItem.title
, the rendered title is only updated after the view controller is fully pushed. Meaning that the user is able to see the title is changing from its default value as defined in the storyboard to the dynamically generated one. This is not the behavior I want.
What is the easiest/correct way to force an update to the visible title before the view controller is presented to the user? Is this even possible?
Thanks, smkuehnhold