HomeiOS DevelopmentiOS UINavigationBar provides title to again button

iOS UINavigationBar provides title to again button [closed]


I need to utterly take away title from again button in UINavigationBar.

I discovered that since iOS 14.0 it may possibly e achieved by including backButtonDisplayMode to high merchandise – navigationBar.topItem?.backButtonDisplayMode = .minimal. I made it inside my subclass of UINavigationController in technique viewWillLayoutSubviews and it labored like a attraction. However there is a matter solely on first launch of an app – once I push a brand new viewController to navigation stack the title of again button is on it is place. And after that the whole lot turns into advantageous and title disappears on each pushing to navigation stack, even after relaunch of an utility

First launch

iOS UINavigationBar provides title to again button [closed]

Each different launches

enter image description here

The code of UINavigationController subclass:

public class MyNavigationController: UINavigationController {
    public override func viewWillLayoutSubviews() {
        tremendous.viewWillLayoutSubviews()
        navigationBar.topItem?.backButtonDisplayMode = .minimal
    }
}

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments