String

struct String

HTML to NSAttributeString methods

  • Generates and attributed string by parsing the receiver’s HTML contents and using a given font as the resulting string base font. Call this from the main thread.

    Declaration

    Swift

    func parseHTML(setting font: OSFontType) throws -> NSAttributedString

    Parameters

    font

    The font to be used as the attributed string base font.

    Return Value

    The generated attributed string.