     @objc open dynamic var font: UIFont? {
         get { return titleTextAttributes(for: .normal)?[NSAttributedStringKey.font.rawValue] as? UIFont }
         set {
-            var attributes = _titleTextAttributes(for: .normal) ?? [:]
+            var attributes = _titleTextAttributes(for: .normal)
             attributes[.font] = newValue
             setTitleTextAttributes(attributes, for: .normal)
         }


extension UIBarButtonItem {
    fileprivate func _titleTextAttributes(for state: UIControlState) -> [NSAttributedStringKey: Any] {
        var oldAttributes = titleTextAttributes(for: state) ?? [:]

        var newAttributes = [NSAttributedStringKey: Any]()


    @objc open dynamic var textColor: UIColor? {
        get { return titleTextAttributes(for: .normal)?[NSAttributedStringKey.foregroundColor.rawValue] as? UIColor }
        set {
            var attributes = _titleTextAttributes(for: .normal)
            attributes[.foregroundColor] = newValue
            setTitleTextAttributes(attributes, for: .normal)
        }
