public class UILongPressGestureRecognizer extends UIGestureRecognizer
Constructor and Description |
---|
UILongPressGestureRecognizer(NSSelector<UIGestureRecognizer> target)
Constructs a new UILongPressGestureRecognizer object and attaches it to
the specified UIGestureRecognizer.
|
Modifier and Type | Method and Description |
---|---|
double |
allowableMovement()
Returns the maximum distance(expressed in points) that the fingers can
move, until the gesture is rejected and not recognized as a long-press
one.
|
boolean |
canBePreventedByGestureRecognizer(UIGestureRecognizer preventing)
Override this method so that the specified UIGestureRecognizer prevents
this UIGestureRecognizer from recognizing a gesture.
|
boolean |
canPreventGestureRecognizer(UIGestureRecognizer preventing)
Override this method so that this UIGestureRecognizer prevents the
specified UIGestureRecognizer from recognizing a gesture.
|
double |
minimumPressDuration()
Returns the minimum touch time that is needed in order to recognize a
gesture as a long-press one.
|
int |
numberOfTapsRequired()
Returns the number of taps that are needed for gesture to be recognized
as long-press one.
|
int |
numberOfTouchesRequired()
Returns the number of fingers needed to touch the screen in order to
recognize a gesture as a long-press one.
|
void |
setAllowableMovement(double allowableMovement)
Sets the maximum distance(expressed in points) that the fingers can move,
until the gesture is rejected and not recognized as a long-press one.
|
void |
setMinimumPressDuration(double minimumPressDuration)
Sets the minimum touch time that is needed in order to recognize a
gesture as a long-press one.
|
void |
setNumberOfTapsRequired(int numberOfTapsRequired)
Sets the number of taps that are needed for gesture to be recognized as
long-press one.
|
void |
setNumberOfTouchesRequired(int numberOfTouchesRequired)
Sets the number of fingers needed to touch the screen in order to
recognize a gesture as a long-press one.
|
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.
|
addTarget, cancelsTouchesInView, delaysTouchesBegan, delaysTouchesEnded, delegate, isEnabled, locationInView, locationOfTouch, numberOfTouches, removeTarget, requireGestureRecognizerToFail, reset, setCancelsTouchesInView, setDelaysTouchesBegan, setDelaysTouchesEnded, setDelegate, setEnabled, state, toString, view
addObserver, observeValueForKeyPath, performSelector, performSelectorOnMainThread, release, removeObserver, removeObserver, retain, setValueForKey, setValueForUndefinedKey, valueForKey, valueForUndefinedKey
public UILongPressGestureRecognizer(NSSelector<UIGestureRecognizer> target)
target
- The UIGestureRecognizer to which the new object is attached
to.public void touchesBegan(Set<UITouch> touches, UIEvent event)
UIGestureRecognizer
touchesBegan
in class UIGestureRecognizer
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)
UIGestureRecognizer
touchesMoved
in class UIGestureRecognizer
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)
UIGestureRecognizer
touchesEnded
in class UIGestureRecognizer
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)
UIGestureRecognizer
touchesCancelled
in class UIGestureRecognizer
touches
- The set of touches until the UITouchPhaseCancelled phase.event
- The event to which the touches belong.public boolean canBePreventedByGestureRecognizer(UIGestureRecognizer preventing)
UIGestureRecognizer
canBePreventedByGestureRecognizer
in class UIGestureRecognizer
preventing
- The UIGestureRecognizer that prevents this gesture
recognizer from recognizing a gesture.public boolean canPreventGestureRecognizer(UIGestureRecognizer preventing)
UIGestureRecognizer
canPreventGestureRecognizer
in class UIGestureRecognizer
preventing
- The UIGestureRecognizer that is prevented from
recognizing a gesture.public int numberOfTapsRequired()
public void setNumberOfTapsRequired(int numberOfTapsRequired)
numberOfTapsRequired
- The number of taps that are needed for
gesture to be recognized as long-press one.public int numberOfTouchesRequired()
public void setNumberOfTouchesRequired(int numberOfTouchesRequired)
numberOfTouchesRequired
- The number of fingers needed to touch the
screen in order to recognize a gesture as a long-press one.public double minimumPressDuration()
public void setMinimumPressDuration(double minimumPressDuration)
minimumPressDuration
- The time that is needed in order to recognize
a gesture as a long-press one.(seconds)public double allowableMovement()
public void setAllowableMovement(double allowableMovement)
allowableMovement
- The maximum distance(expressed in points) that
the fingers can move.Copyright © 2020. All rights reserved.