loadFromHTML(data:options:completionHandler:)
Creates an attributed string from the specified HTML data.
Declaration
class func loadFromHTML(data: Data, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:], completionHandler: @escaping @Sendable (NSAttributedString?, [NSAttributedString.DocumentAttributeKey : Any]?, (any Error)?) -> Void)class func fromHTML(_ data: Data, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:]) async throws -> (NSAttributedString, [NSAttributedString.DocumentAttributeKey : Any])Parameters
- data:
A data object with text in HTML format. The method uses this data to create the attributed string.
- options:
Specifies additional options for loading the document. For a list of possible keys, see Nsattributedstringdocumentreadingoptionkey.
- completionHandler:
A completion handler to execute with the results.