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?) -> ListLineMarkerParameters
rendererRenderer in which list marker is being drawn.
indexIndex of list item in the given list.
levelIndentation level of the list.
previousLevelPrevious indentation level. Using this, it can be determined if the list is being indented, outdented or is at same level.
attributeValueValue 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.
View on GitHub
RendererListFormattingProvider Protocol Reference