ListItem

public struct ListItem

Represents an item in the list. This structure may be used to create NSAttributedString from items in an array of ListItem. Alternatively, NSAttributedString may also be parsed to get an array of ListItems.

  • Text of the list item. All attributes are preserved as is.

    Note

    If the text contains a newline (\n), it is preserved as a newline in text by applying .skipNextListMarker attribute.

    Declaration

    Swift

    public let text: NSAttributedString
  • Level of the list item. This is used with indent to get paragraphStyle to be applied with appropriate indentation of the list items.

    Declaration

    Swift

    public let level: Int
  • Attribute value of the list item.

    Declaration

    Swift

    public let attributeValue: Any
  • Creates a ListItem

    Declaration

    Swift

    public init(text: NSAttributedString, level: Int, attributeValue: Any)

    Parameters

    text

    Attributed value for text in ListItem

    level

    Indentation level of ListItem.

    attributeValue

    Attribute value to be applied to entire text range of ListItem