I have added the following code to hide the back button title on the navigation bar but it is not working on iOS 15.
UIBarButtonItem.appearance().setBackButtonTitlePositionAdjustment(UIOffset(horizontal: -1000, vertical: 0),
for: UIBarMetrics.default)
can someone help me plz?
CodePudding user response:
You will want to do this on your navigation bar button:
navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil)
The title will need to be an empty string and that gets rid of the title.
CodePudding user response:
I have resolve this by using following method :
let appearance = UINavigationBarAppearance()
appearance.backButtonAppearance.normal.titlePositionAdjustment = UIOffset(horizontal: -1000, vertical: 0)