Instance Method

cancelPerform(_:target:argument:)

Cancels the sending of a previously scheduled message.

Declaration

func cancelPerform(_ aSelector: Selector, target: Any, argument arg: Any?)

Parameters

aSelector

The previously-specified selector.

target

The previously-specified target.

anArgument

The previously-specified argument.

Discussion

You can use this method to cancel a message previously scheduled using the perform(_:target:argument:order:modes:) method. The parameters identify the message you want to cancel and must match those originally specified when the selector was scheduled. This method removes the perform request from all modes of the run loop.

See Also

Scheduling and Canceling Messages

func cancelPerformSelectors(withTarget: Any)

Cancels all outstanding ordered performs scheduled with a given target.