RendererCommand
public protocol RendererCommand
Describes a command that can be executed on RendererView. A command may be invoked directly on the renderer by providing an instance.
However, in a typical usage scenario, these should be invoked via RendererCommandExecutor which manages all the RendererViews in the
view including the ones that are contained in the attachments.
-
Identifies a command. This value is used to maintain unique registrations of commands in an Renderer. Adding a command with the same name as one registered already would end up replacing the previously registered command with the same name.
Declaration
Swift
var name: CommandName { get } -
canExecute(on:Default implementation) Determines if the current command can be executed on the given
RendererView. When a command is executed usingRendererCommandExecutor, it ensures that only the commands returningtruefor the activeRendererVieware executed when invoked. Defaults totrue.Default Implementation
Declaration
Swift
func canExecute(on renderer: RendererView) -> BoolParameters
rendererEditorViewto execute the command on. -
Execute the command on the given
EditorView. You may useselectedRangeproperty ofEditorViewif the command operates on the selected text only. for e.g. a command to make selected text bold.Declaration
Swift
func execute(on renderer: RendererView)Parameters
rendererEditorViewto execute the command on.
View on GitHub
RendererCommand Protocol Reference