J'ai converti mon application récemment et je reçois toujours l'erreur
"Impossible de convertir la valeur de type '[String: Any]' en type d'argument attendu '[NSAttributedStringKey: Any]?'
barButtonItem.setTitleTextAttributes(attributes, for: .normal)
Code entier:
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
}