Documentation Language: Swift

Class

CompoundCommand

Command that executes multiple commands as a single atomic operation.

@MainActor final class CompoundCommand

Overview

CompoundCommand allows multiple individual commands to be grouped together and executed as a single unit, with all-or-nothing semantics for undo/redo.

Topics

Initializers

?
init(commands:)

Creates a new compound command.

Instance Properties

V
canRedo

Indicates whether the command can be redone after being undone.

V
canUndo

Indicates whether the command can be undone.

V
description

A human-readable description of the command.

Instance Methods

F
execute()

Execute the command, applying its changes to the model.

F
redo()

Redo the command, re-applying its changes after undo.

F
undo()

Undo the command, reversing its changes to the model.

Relationships

Inherits From

Conforms To