Contents

init(HTML:options:documentAttributes:)

Creates an attributed string from the HTML in the specified data object.

Declaration

init?(HTML data: Data, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:], documentAttributes dict: AutoreleasingUnsafeMutablePointer<NSDictionary?>?)
init?(html data: Data, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:], documentAttributes dict: AutoreleasingUnsafeMutablePointer<NSDictionary?>?)

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.

  • dict:

    An in-out dictionary containing document-level attributes. On output, this method updates the dictionary to contain any document-specific keys found in the data. Specify nil if you don’t want the document attributes.

Return Value

Returns an initialized object, or nil if the data can’t be decoded.

See Also

Creating from HTML