Tag: nsattributedstringkey

Nicht konvertieren kann der Wert vom Typ NSAttributedString.DocumentAttributeKey .DocumentReadingOptionKey

Anzahl der Antworten 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

Nicht konvertieren kann der Wert des Typs '[String : AnyObject]?' erwartet Argumenttyp '[NSAttributedStringKey : Jede]?'

Anzahl der Antworten 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 ==