I converted my app recently and I keep getting the error 

> 
> "Cannot convert value of type '[String : Any]' to expected argument type '[NSAttributedStringKey: Any]?'
> 
> 
> 

`barButtonItem.setTitleTextAttributes(attributes, for: .normal)`

Whole code:

```
 class func getBarButtonItem(title:String) -> UIBarButtonItem {
    let barButtonItem = UIBarButtonItem.init(title: title, style: .plain, target: nil, action: nil)
    let attributes = [NSAttributedStringKey.font.rawValue:  UIFont(name: "Helvetica-Bold", size: 15.0)!, NSAttributedStringKey.foregroundColor: UIColor.white] as! [String : Any]
    barButtonItem.setTitleTextAttributes(attributes, for: .normal)

    return barButtonItem
}

```