public abstract class UIGestureRecognizer extends NSObject
Constructor and Description |
---|
UIGestureRecognizer(NSSelector<UIGestureRecognizer> target)
Constructs a UIGestureRecognizer and associates it with the specified
target.
|
Modifier and Type | Method and Description |
---|---|
void |
addTarget(NSSelector<UIGestureRecognizer> target)
Adds the target defined as parameter to this UIGestureRecognizer.
|
abstract boolean |
canBePreventedByGestureRecognizer(UIGestureRecognizer preventing)
Override this method so that the specified UIGestureRecognizer prevents
this UIGestureRecognizer from recognizing a gesture.
|
boolean |
cancelsTouchesInView()
Returns a Boolean that shows whether touches are passed to a view when an
event is perceived as a gesture.
|
abstract boolean |
canPreventGestureRecognizer(UIGestureRecognizer preventing)
Override this method so that this UIGestureRecognizer prevents the
specified UIGestureRecognizer from recognizing a gesture.
|
boolean |
delaysTouchesBegan()
Returns a Boolean that shows whether there is an initial delay in sending
touches to the view for this UIGestureRecognizer.
|
boolean |
delaysTouchesEnded()
Returns a Boolean that shows whether there is a delay in sending touches
to the view, at the end of the phase, for this UIGestureRecognizer.
|
UIGestureRecognizerDelegate |
delegate()
Returns the delegate object for this UIGestureRecognizer.
|
boolean |
isEnabled()
Returns a Boolean that shows whether this UIGestureRecognizer is enabled
or not.
|
CGPoint |
locationInView(UIView view)
Returns the location of the gesture for this receiver, expressed in the
coordinate system of the view that is passed as parameter.
|
CGPoint |
locationOfTouch(int touch,
UIView view)
Returns the location of the touch parameter expressed in the coordinate
system of the view that is passed as parameter.
|
int |
numberOfTouches()
Returns the number of touches that constitute this gesture.
|
void |
removeTarget(NSSelector<UIGestureRecognizer> target)
Removes the target defined as parameter from this UIGestureRecognizer.
|
void |
requireGestureRecognizerToFail(UIGestureRecognizer other)
Connects this UIGestureRecognizer with corresponding that is passed as
parameter.
|
void |
reset()
Resets internal state when the gesture recognition is completed.
|
void |
setCancelsTouchesInView(boolean cancelsTouchesInView)
Set a Boolean that defines whether touches are passed to a view when an
event is perceived as a gesture.
|
void |
setDelaysTouchesBegan(boolean delaysTouchesBegan)
Sets a Boolean that defines whether there is an initial delay in sending
touches to the view for this UIGestureRecognizer.
|
void |
setDelaysTouchesEnded(boolean delaysTouchesEnded)
Sets a Boolean that defines whether there is a delay in sending touches
to the view, at the end of the phase, for this UIGestureRecognizer.
|
void |
setDelegate(UIGestureRecognizerDelegate delegate)
Sets the delegate object for this UIGestureRecognizer.
|
void |
setEnabled(boolean enabled)
Sets a Boolean that defines whether this UIGestureRecognizer is enabled
or not.
|
int |
state()
Returns the current state for this UIGestureRecognizer.
|
String |
toString() |
void |
touchesBegan(Set<UITouch> touches,
UIEvent event)
Informs this UIGestureRecognizer when one or more fingers touched down in
the associated UIView.
|
void |
touchesCancelled(Set<UITouch> touches,
UIEvent event)
Informs this UIGestureRecognizer that a touch event was canceled due to
system event.
|
void |
touchesEnded(Set<UITouch> touches,
UIEvent event)
Informs this UIGestureRecognizer when one or more fingers were lifted
from the associated view.
|
void |
touchesMoved(Set<UITouch> touches,
UIEvent event)
Informs this UIGestureRecognizer when one or more fingers were moved
within the associated view.
|
UIView |
view()
Returns the view for this UIGestureRecognizer.
|
addObserver, observeValueForKeyPath, performSelector, performSelectorOnMainThread, release, removeObserver, removeObserver, retain, setValueForKey, setValueForUndefinedKey, valueForKey, valueForUndefinedKey
public UIGestureRecognizer(NSSelector<UIGestureRecognizer> target)
target
- The target of the new UIGestureRecognizer.public void addTarget(NSSelector<UIGestureRecognizer> target)
target
- The target to be added to the UIGestureRecognizer.public void removeTarget(NSSelector<UIGestureRecognizer> target)
target
- The target to be removed from this UIGestureRecognizer.public CGPoint locationInView(UIView view)
view
- The view in whose coordinate system the location is defined.public CGPoint locationOfTouch(int touch, UIView view)
touch
- The touch for which the location is computed.view
- The view in whose coordinate system the location is defined.public int numberOfTouches()
public UIView view()
public UIGestureRecognizerDelegate delegate()
public void setDelegate(UIGestureRecognizerDelegate delegate)
delegate
- The delegate object for this UIGestureRecognizer.public boolean isEnabled()
public void setEnabled(boolean enabled)
enabled
- Boolean that defines whether this UIGestureRecognizer is
enabled or not.public boolean cancelsTouchesInView()
public void setCancelsTouchesInView(boolean cancelsTouchesInView)
cancelsTouchesInView
- Boolean that defines whether touches are
passed to a view when an event is perceived as a gesture.public boolean delaysTouchesBegan()
public void setDelaysTouchesBegan(boolean delaysTouchesBegan)
delaysTouchesBegan
- Boolean that defines whether there is an
initial delay in sending touches to the view for this
UIGestureRecognizer.public boolean delaysTouchesEnded()
public void setDelaysTouchesEnded(boolean delaysTouchesEnded)
delaysTouchesEnded
- Boolean that shows whether there is a delay in
sending touches to the view, at the end of the phase, for this
UIGestureRecognizer.public int state()
public void requireGestureRecognizerToFail(UIGestureRecognizer other)
other
- The UIGestureRecognizer that is to be connected to this.public void reset()
public void touchesBegan(Set<UITouch> touches, UIEvent event)
touches
- The set of touches until the UITouchPhaseCancelled phase.event
- The event to which the touches belong.public void touchesMoved(Set<UITouch> touches, UIEvent event)
touches
- The set of touches until the UITouchPhaseCancelled phase.event
- The event to which the touches belong.public void touchesEnded(Set<UITouch> touches, UIEvent event)
touches
- The set of touches until the UITouchPhaseCancelled phase.event
- The event to which the touches belong.public void touchesCancelled(Set<UITouch> touches, UIEvent event)
touches
- The set of touches until the UITouchPhaseCancelled phase.event
- The event to which the touches belong.public abstract boolean canBePreventedByGestureRecognizer(UIGestureRecognizer preventing)
preventing
- The UIGestureRecognizer that prevents this gesture
recognizer from recognizing a gesture.public abstract boolean canPreventGestureRecognizer(UIGestureRecognizer preventing)
preventing
- The UIGestureRecognizer that is prevented from
recognizing a gesture.Copyright © 2020. All rights reserved.