RendererListFormattingProvider

public protocol RendererListFormattingProvider : AnyObject

Describes an object capable of providing style and formatting information for rendering lists in EditorView.

  • Line formatting to be used for a list item.

    Declaration

    Swift

    var listLineFormatting: LineFormatting { get }
  • Returns the marker to be drawn for list item (bullet/number etc.) for given parameters.

    Note

    This function is called multiple times for same index level based on TextKit layout cycles. It is advisable to cache the values if calculation/drawing is performance intensive.

    Declaration

    Swift

    func listLineMarkerFor(renderer: RendererView, index: Int, level: Int, previousLevel: Int, attributeValue: Any?) -> ListLineMarker

    Parameters

    renderer

    Renderer in which list marker is being drawn.

    index

    Index of list item in the given list.

    level

    Indentation level of the list.

    previousLevel

    Previous indentation level. Using this, it can be determined if the list is being indented, outdented or is at same level.

    attributeValue

    Value of list item attribute for given index. Nil if there is no content set in list item yet.

    Return Value

    Marker to be drawn for the given list item.