removeTarget(_:action:)
Removes a target and an action from a gesture-recognizer object.
Declaration
func removeTarget(_ target: Any?, action: Selector?)Parameters
- target:
An object that currently is a recipient of action messages sent by the receiver when the represented gesture occurs. Specify
nilif you want to remove all targets from the receiver. - action:
A selector identifying a method of a target to be invoked by the action message. Specify
NULLif you want to remove all actions from the receiver.
Discussion
Calling this method removes the specified target-action pair. Passing nil for target matches all targets and passing NULL for action matches all actions.