ListCommand
public class ListCommand : EditorCommand
Command that can be used to toggle list attributes of selected range of text. If the length of selected range of text is 0, the attributes are applied on the current line of text.
-
Undocumented
Declaration
Swift
public init() -
Name of the command
Declaration
Swift
public var name: CommandName { get } -
Value to be set for attribute
.listItemwhen applying to a range of text. This value is returned back byListFormattingProviderwhen querying list marker for a given index. This may be used to store info that helps generate appropriate markers for e.g. storing context related to bullet vs ordered lists.Note
When set to nil before runningexecute, it removes list formatting from the selected range of text.Declaration
Swift
public var attributeValue: Any? -
Executes the command with value of
attributeValuefor.listItemattribute. If theattributeValueis nil, executing removed list formatting from the selected range of text.Declaration
Swift
public func execute(on editor: EditorView)Parameters
editorEditor to execute the command on.
-
Executes the command with value of
attributeValuefor.listItemattribute.Declaration
Swift
public func execute(on editor: EditorView, attributeValue: Any?)Parameters
editorEditor to execute the command on.
attributeValueValue of
.listItemattribute. Use nil to remove list formatting.
View on GitHub
ListCommand Class Reference