Comment faire pour convertir les valeurs de type '[String : AnyObject]?'
en type d'argument attendu '[NSAttributedStringKey : Any]?'
? pour les clésImpossible de convertir la valeur de type '[String: AnyObject]?' au type d'argument attendu '[NSAttributedStringKey: Any]?'
open class func drawText(context: CGContext, text: String, point: CGPoint,
align: NSTextAlignment, attributes: [String : AnyObject]?)
{
var point = point
if align == .center
{
point.x -= text.size(withAttributes: attributes).width/2.0
}
else if align == .right
{
point.x -= text.size(withAttributes: attributes).width
}
NSUIGraphicsPushContext(context)
(text as NSString).draw(at: point, withAttributes: attributes)
NSUIGraphicsPopContext()
}
Merci pour votre aide :) –