I want to remove the text from the back button, but I want to keep the icon. I have tried
let backButton = UIBarButtonItem(title: \"\", style: UIBarButtonIt
This will solve your issue:
import UIKit
extension UINavigationController{
func customizeBackArrow(){
let yourBackImage = UIImage(named: "icon_back_arrow")
self.navigationBar.backIndicatorImage = yourBackImage
self.navigationBar.tintColor = Common.offBlackColor
self.navigationBar.backIndicatorTransitionMaskImage = yourBackImage
navigationItem.leftItemsSupplementBackButton = true
self.navigationBar.topItem?.backBarButtonItem = UIBarButtonItem(title: "",
style: .plain, target: self, action: nil)
}
}