title: Cannot convert value of type '[String : AnyObject]?' to expected argument type '[NSAttributedStringKey : Any]?'
body: <p>How to convert values of type <code>'[String : AnyObject]?'</code>to expected argument type <code>'[NSAttributedStringKey : Any]?'</code>?</p>
  
  <pre><code>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()
  }
  </code></pre>