I have UINavigationController with 2 view controllers vc1
and vc2
(vc1
pushes vc2
). I need to set back button title of vc2
, so I do it by:
vc1.navigationItem.backBarButtonItem
= UIBarButtonItem(title: title, style: .plain, target: nil, action: nil)
But this back button title
is a counter, I get it from Database, so I usually set it after viewWillAppear
but before viewDidAppear
(it happens during navigation controller transition from vc1
to vc2
)
But the back button title
is applied only after the transition is completed. As a comparison if I use leftBarButtonItem
with custom view
, the title is applied before the transition is completed. But I'm not allowed to use leftBarButtonItem
Here is the Video how it looks like (it's possible to notice if you scroll video slowly)
Is it possible somehow to force update back button title before the transition is completed?