7
Antworten
Fand ich diese Zeichenfolge Erweiterung irgendwo auf, SO dass mir erlaubt, zu drehen, html-code in ein attributiertes string: func html2AttributedString() -> NSAttributedString { return try! NSAttributedString(data: self.data(using: String.Encoding.unicode, allowLossyConversion: true)!, options: [NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType], documentAttributes: nil) } Lief
3
Antworten
Wie konvertiert man die Werte des Typs '[String : AnyObject]?'erwarteten Argumenttyp '[NSAttributedStringKey : Any]?'? open class func drawText(context: CGContext, text: String, point: CGPoint, align: NSTextAlignment, attributes: [String : AnyObject]?) { var point = point if align ==