Bearbeiten

Freigeben über


UIGestureRecognizer.AddTarget Method

Definition

Overloads

AddTarget(Action)

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

AddTarget(Action<NSObject>)

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

AddTarget(NSObject, Selector)

Low-level version of AddTarget.

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

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.

Applies to

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.

Applies to

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

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

action
Selector

The selector to invoke on the specified NSObject instance.

Attributes

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