Instance Method

execute()

Executes the command if it is valid and returns the result, if any.

Declaration

func execute() -> Any?

Discussion

Before this method executes the command (through NSInvocation mechanisms), it evaluates all object specifiers involved in the command, validates that the receivers can actually handle the command, and verifies that the types of any arguments that were initially object specifiers are valid.

You shouldn’t have to override this method. If the command’s receivers want to handle the command themselves, this method invokes their defined handler. Otherwise, it invokes performDefaultImplementation().

See Also

Executing the command

func performDefaultImplementation() -> Any?

Overridden by subclasses to provide a default implementation for the command represented by the receiver.