I’ve a customized UINavigationController like so:

class CustomNavigationController: UINavigationController {

    override func viewDidLoad() {
        tremendous.viewDidLoad()

        // Do any further setup after loading the view.
        delegate = self
        setupDefaultAppearance()
    }
    
    non-public func setupDefaultAppearance() {
        UINavigationBar.look().tintColor = R.shade.textBlack()
        
        let titleAttributes: [NSAttributedString.Key: Any] = [ .font: R.font.interMedium(size: 18)! ]
        UINavigationBar.look().titleTextAttributes = titleAttributes
        
        // Conceal the title in bar button objects
        let backButtonAttributes: [NSAttributedString.Key: Any] = [ .font: UIFont(name: "Helvetica-Bold", size: 0.1)!,
                                                                    .foregroundColor: UIColor.clear]

        UIBarButtonItem.look().setTitleTextAttributes(backButtonAttributes, for: .regular)
        UIBarButtonItem.look().setTitleTextAttributes(backButtonAttributes, for: .highlighted)
    }
}

Nonetheless, the code to cover the title in bar button objects screwed IQKeyboardManager. The Achieved button (or any button on the toolbar) within the keyboard or any picker view is gone now due to this. So, I consider I mustn’t use the UIBarButtonItem.look() static func. How do I take away the title of the Navigation Controller’s again button with out making the bug within the keyboard and picker views?

Thanks.

By admin

Leave a Reply

Your email address will not be published.