UIGestureRecognizer.AddTarget UIGestureRecognizer.AddTarget Method

Definition

Overloads

AddTarget(Action) AddTarget(Action)

Registers a new callback for when the gesture has been recognized.

AddTarget(Action<NSObject>) AddTarget(Action<NSObject>)

Registers a new callback for when the gesture has been recognized.

AddTarget(NSObject, Selector) AddTarget(NSObject, Selector)

Low-level version of AddTarget.

AddTarget(Action) AddTarget(Action)

Registers a new callback for when the gesture has been recognized.

public UIKit.UIGestureRecognizer.Token AddTarget (Action action);
member this.AddTarget : Action -> UIKit.UIGestureRecognizer.Token

Parameters

action
Action Action

The method to invoke when the gesture has been recognized.

Returns

The returned token can be used later to remove this particular action from being invoked by the gesture recognizer.

AddTarget(Action<NSObject>) AddTarget(Action<NSObject>)

Registers a new callback for when the gesture has been recognized.

public UIKit.UIGestureRecognizer.Token AddTarget (Action<Foundation.NSObject> action);
member this.AddTarget : Action<Foundation.NSObject> -> UIKit.UIGestureRecognizer.Token

Parameters

action
Action<NSObject>

The method to invoke when the gesture has been recognized.

Returns

The returned token can be used later to remove this particular action from being invoked by the gesture recognizer using the RemoveTarget(NSObject, Selector) method.

AddTarget(NSObject, Selector) AddTarget(NSObject, Selector)

Low-level version of AddTarget.

[Foundation.Export("addTarget:action:")]
public virtual void AddTarget (Foundation.NSObject target, ObjCRuntime.Selector action);
abstract member AddTarget : Foundation.NSObject * ObjCRuntime.Selector -> unit
override this.AddTarget : Foundation.NSObject * ObjCRuntime.Selector -> unit

Parameters

target
NSObject NSObject

An instance of NSObject that holds a method flagged with the specified selector.

action
Selector Selector

The selector to invoke on the specified NSObject instance.

Remarks

Unlike the C#-based AddTarget method, this version of AddTarget requires both an NSObject instance plus a selector to invoke when the gesture is recognized.

Applies to