Class UIGestureRecognizer

All Implemented Interfaces:
NSObjectProtocol, ObjCProtocol
Direct Known Subclasses:
UIHoverGestureRecognizer, UILongPressGestureRecognizer, UIPanGestureRecognizer, UIPinchGestureRecognizer, UIRotationGestureRecognizer, UISwipeGestureRecognizer, UITapGestureRecognizer

public class UIGestureRecognizer
extends NSObject
  • Constructor Details

    • UIGestureRecognizer

      public UIGestureRecognizer​(UIGestureRecognizer.OnGestureListener listener)
    • UIGestureRecognizer

      public UIGestureRecognizer()
    • UIGestureRecognizer

      protected UIGestureRecognizer​(NSObject.Handle h, long handle)
    • UIGestureRecognizer

      protected UIGestureRecognizer​(NSObject.SkipInit skipInit)
    • UIGestureRecognizer

      public UIGestureRecognizer​(NSObject target, Selector action)
    • UIGestureRecognizer

      public UIGestureRecognizer​(NSCoder coder)
  • Method Details

    • addListener

      public void addListener​(UIGestureRecognizer.OnGestureListener listener)
    • removeListener

      public void removeListener​(UIGestureRecognizer.OnGestureListener listener)
    • getState

      public UIGestureRecognizerState getState()
    • getDelegate

      public UIGestureRecognizerDelegate getDelegate()
    • setDelegate

      public void setDelegate​(UIGestureRecognizerDelegate v)
    • isEnabled

      public boolean isEnabled()
    • setEnabled

      public void setEnabled​(boolean v)
    • getView

      public UIView getView()
    • cancelsTouchesInView

      public boolean cancelsTouchesInView()
    • setCancelsTouchesInView

      public void setCancelsTouchesInView​(boolean v)
    • delaysTouchesBegan

      public boolean delaysTouchesBegan()
    • setDelaysTouchesBegan

      public void setDelaysTouchesBegan​(boolean v)
    • delaysTouchesEnded

      public boolean delaysTouchesEnded()
    • setDelaysTouchesEnded

      public void setDelaysTouchesEnded​(boolean v)
    • getAllowedTouchTypes

      public List<UITouchType> getAllowedTouchTypes()
      Since:
      Available in iOS 9.0 and later.
    • setAllowedTouchTypes

      public void setAllowedTouchTypes​(List<UITouchType> v)
      Since:
      Available in iOS 9.0 and later.
    • getAllowedPressTypes

      public List<UIPressType> getAllowedPressTypes()
      Since:
      Available in iOS 9.0 and later.
    • setAllowedPressTypes

      public void setAllowedPressTypes​(List<UIPressType> v)
      Since:
      Available in iOS 9.0 and later.
    • requiresExclusiveTouchType

      public boolean requiresExclusiveTouchType()
      Since:
      Available in iOS 9.2 and later.
    • setRequiresExclusiveTouchType

      public void setRequiresExclusiveTouchType​(boolean v)
      Since:
      Available in iOS 9.2 and later.
    • getNumberOfTouches

      public long getNumberOfTouches()
    • getName

      public String getName()
      Since:
      Available in iOS 11.0 and later.
    • setName

      public void setName​(String v)
      Since:
      Available in iOS 11.0 and later.
    • getModifierFlags

      public UIKeyModifierFlags getModifierFlags()
      Since:
      Available in iOS 13.4 and later.
    • getButtonMask

      public UIEventButtonMask getButtonMask()
      Since:
      Available in iOS 13.4 and later.
    • setState

      public void setState​(UIGestureRecognizerState v)
    • init

      protected long init​(NSObject target, Selector action)
    • init

      protected long init​(NSCoder coder)
    • addTarget

      public void addTarget​(NSObject target, Selector action)
    • removeTarget

      public void removeTarget​(NSObject target, Selector action)
    • requireGestureRecognizerToFail

      public void requireGestureRecognizerToFail​(UIGestureRecognizer otherGestureRecognizer)
    • getLocationInView

      public CGPoint getLocationInView​(UIView view)
    • getLocationOfTouch

      public CGPoint getLocationOfTouch​(long touchIndex, UIView view)
    • ignoreTouch

      protected void ignoreTouch​(UITouch touch, UIEvent event)
    • ignorePress

      protected void ignorePress​(UIPress button, UIPressesEvent event)
      Since:
      Available in iOS 9.0 and later.
    • reset

      public void reset()
    • canPreventGestureRecognizer

      public boolean canPreventGestureRecognizer​(UIGestureRecognizer preventedGestureRecognizer)
    • canBePreventedByGestureRecognizer

      public boolean canBePreventedByGestureRecognizer​(UIGestureRecognizer preventingGestureRecognizer)
    • shouldRequireFailureOfGestureRecognizer

      public boolean shouldRequireFailureOfGestureRecognizer​(UIGestureRecognizer otherGestureRecognizer)
    • shouldBeRequiredToFailByGestureRecognizer

      public boolean shouldBeRequiredToFailByGestureRecognizer​(UIGestureRecognizer otherGestureRecognizer)
    • shouldReceiveEvent

      public boolean shouldReceiveEvent​(UIEvent event)
      Since:
      Available in iOS 13.4 and later.
    • touchesBegan

      protected void touchesBegan​(NSSet<UITouch> touches, UIEvent event)
    • touchesMoved

      protected void touchesMoved​(NSSet<UITouch> touches, UIEvent event)
    • touchesEnded

      protected void touchesEnded​(NSSet<UITouch> touches, UIEvent event)
    • touchesCancelled

      protected void touchesCancelled​(NSSet<UITouch> touches, UIEvent event)
    • touchesEstimatedPropertiesUpdated

      public void touchesEstimatedPropertiesUpdated​(NSSet<UITouch> touches)
      Since:
      Available in iOS 9.1 and later.
    • pressesBegan

      protected void pressesBegan​(NSSet<UIPress> presses, UIPressesEvent event)
      Since:
      Available in iOS 9.0 and later.
    • pressesChanged

      protected void pressesChanged​(NSSet<UIPress> presses, UIPressesEvent event)
      Since:
      Available in iOS 9.0 and later.
    • pressesEnded

      protected void pressesEnded​(NSSet<UIPress> presses, UIPressesEvent event)
      Since:
      Available in iOS 9.0 and later.
    • pressesCancelled

      protected void pressesCancelled​(NSSet<UIPress> presses, UIPressesEvent event)
      Since:
      Available in iOS 9.0 and later.