iOS 14 introduced configurable Back button mode. Eg. you can have "Back" label text on the button, but in the compact history menu you can still see the proper title of previous controllers.
I'm looking for a easy, pleasant way to configure the default mode, so all UIViewController instances during runtime will have default mode set, like UINavigationItemBackButtonDisplayModeGeneric
I wonder if there is a way to do that without subclassing UIViewController or remember to always configure manually every instance of UIViewController
(via viewController.navigationItem.backButtonDisplayMode = UINavigationItemBackButtonDisplayModeGeneric
).
Any handy method which does not require extensive refactoring of hundreds of UIViewController instances greatly appreciated!
Without subclassing I think is not possible since
navigationItem
requires an instance to work with and can't be modified directly from extensionsAnd use that where ever you need
This is a really good approach since you have control over what implements it and what's not considering that it might not be there in all scenes