Package apple.uikit
Class UIGestureRecognizer
- java.lang.Object
-
- org.moe.natj.general.NativeObject
-
- org.moe.natj.objc.ObjCObject
-
- apple.NSObject
-
- apple.uikit.UIGestureRecognizer
-
- All Implemented Interfaces:
NSObject
- Direct Known Subclasses:
UIHoverGestureRecognizer,UILongPressGestureRecognizer,UIPanGestureRecognizer,UIPinchGestureRecognizer,UIRotationGestureRecognizer,UISwipeGestureRecognizer,UITapGestureRecognizer
public class UIGestureRecognizer extends NSObject
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class apple.NSObject
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedUIGestureRecognizer(org.moe.natj.general.Pointer peer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleanaccessInstanceVariablesDirectly()voidaddTargetAction(java.lang.Object target, org.moe.natj.objc.SEL action)add a target/action pair. you can call this multiple times to specify multiple target/actionsstatic UIGestureRecognizeralloc()static java.lang.ObjectallocWithZone(org.moe.natj.general.ptr.VoidPtr zone)NSArray<? extends NSNumber>allowedPressTypes()Array of UIPressTypes as NSNumbers.NSArray<? extends NSNumber>allowedTouchTypes()Array of UITouchTypes as NSNumbers.static booleanautomaticallyNotifiesObserversForKey(java.lang.String key)longbuttonMask()booleancanBePreventedByGestureRecognizer(UIGestureRecognizer preventingGestureRecognizer)static voidcancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)static voidcancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)booleancancelsTouchesInView()default is YES. causes touchesCancelled:withEvent: or pressesCancelled:withEvent: to be sent to the view for all touches or presses recognized as part of this gesture immediately before the action method is called.booleancanPreventGestureRecognizer(UIGestureRecognizer preventedGestureRecognizer)same behavior as the equivalent delegate methods, but can be used by subclasses to define class-wide prevention rules for example, a UITapGestureRecognizer never prevents another UITapGestureRecognizer with a higher tap countstatic NSArray<java.lang.String>classFallbacksForKeyedArchiver()static org.moe.natj.objc.ClassclassForKeyedUnarchiver()static java.lang.StringdebugDescription_static()booleandelaysTouchesBegan()default is NO.booleandelaysTouchesEnded()default is YES. causes touchesEnded or pressesEnded events to be delivered to the target view only after this gesture has failed recognition. this ensures that a touch or press that is part of the gesture can be cancelled if the gesture is recognizedUIGestureRecognizerDelegatedelegate()the gesture recognizer's delegatestatic java.lang.Stringdescription_static()static longhash_static()voidignorePressForEvent(UIPress button, UIPressesEvent event)voidignoreTouchForEvent(UITouch touch, UIEvent event)if a touch isn't part of this gesture it can be passed to this method to be ignored. ignored touches won't be cancelled on the view even if cancelsTouchesInView is YESUIGestureRecognizerinit()UIGestureRecognizerinitWithCoder(NSCoder coder)UIGestureRecognizerinitWithTargetAction(java.lang.Object target, org.moe.natj.objc.SEL action)designated initializerstatic NSObject.Function_instanceMethodForSelector_retinstanceMethodForSelector(org.moe.natj.objc.SEL aSelector)static NSMethodSignatureinstanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)static booleaninstancesRespondToSelector(org.moe.natj.objc.SEL aSelector)booleanisEnabled()default is YES. disabled gesture recognizers will not receive touches. when changed to NO the gesture recognizer will be cancelled if it's currently recognizing a gesturestatic booleanisSubclassOfClass(org.moe.natj.objc.Class aClass)static NSSet<java.lang.String>keyPathsForValuesAffectingValueForKey(java.lang.String key)CGPointlocationInView(UIView view)a generic single-point location for the gesture. usually the centroid of the touches involvedCGPointlocationOfTouchInView(long touchIndex, UIView view)the location of a particular touchlongmodifierFlags()Values from the last event processed.java.lang.Stringname()name for debugging to appear in loggingstatic java.lang.Objectnew_objc()longnumberOfTouches()number of touches involved for which locations can be queriedvoidpressesBeganWithEvent(NSSet<? extends UIPress> presses, UIPressesEvent event)voidpressesCancelledWithEvent(NSSet<? extends UIPress> presses, UIPressesEvent event)voidpressesChangedWithEvent(NSSet<? extends UIPress> presses, UIPressesEvent event)voidpressesEndedWithEvent(NSSet<? extends UIPress> presses, UIPressesEvent event)voidremoveTargetAction(java.lang.Object target, org.moe.natj.objc.SEL action)remove the specified target/action pair. passing nil for target matches all targets, and the same for actionsvoidrequireGestureRecognizerToFail(UIGestureRecognizer otherGestureRecognizer)create a relationship with another gesture recognizer that will prevent this gesture's actions from being called until otherGestureRecognizer transitions to UIGestureRecognizerStateFailed if otherGestureRecognizer transitions to UIGestureRecognizerStateRecognized or UIGestureRecognizerStateBegan then this recognizer will instead transition to UIGestureRecognizerStateFailed example usage: a single tap may require a double tap to failbooleanrequiresExclusiveTouchType()defaults to YESvoidreset()called automatically by the runtime after the gesture state has been set to UIGestureRecognizerStateEnded any internal state should be reset to prepare for a new attempt to recognize the gesture after this is received all remaining active touches will be ignored (no further updates will be received for touches that had already begun but haven't ended)static booleanresolveClassMethod(org.moe.natj.objc.SEL sel)static booleanresolveInstanceMethod(org.moe.natj.objc.SEL sel)voidsetAllowedPressTypes(NSArray<? extends NSNumber> value)Array of UIPressTypes as NSNumbers.voidsetAllowedTouchTypes(NSArray<? extends NSNumber> value)Array of UITouchTypes as NSNumbers.voidsetCancelsTouchesInView(boolean value)default is YES. causes touchesCancelled:withEvent: or pressesCancelled:withEvent: to be sent to the view for all touches or presses recognized as part of this gesture immediately before the action method is called.voidsetDelaysTouchesBegan(boolean value)default is NO.voidsetDelaysTouchesEnded(boolean value)default is YES. causes touchesEnded or pressesEnded events to be delivered to the target view only after this gesture has failed recognition. this ensures that a touch or press that is part of the gesture can be cancelled if the gesture is recognizedvoidsetDelegate(UIGestureRecognizerDelegate value)the gesture recognizer's delegatevoidsetDelegate_unsafe(UIGestureRecognizerDelegate value)the gesture recognizer's delegatevoidsetEnabled(boolean value)default is YES. disabled gesture recognizers will not receive touches. when changed to NO the gesture recognizer will be cancelled if it's currently recognizing a gesturevoidsetName(java.lang.String value)name for debugging to appear in loggingvoidsetRequiresExclusiveTouchType(boolean value)defaults to YESvoidsetState(long value)the current state of the gesture recognizer. can only be set by subclasses of UIGestureRecognizer, but can be read by consumersstatic voidsetVersion_static(long aVersion)booleanshouldBeRequiredToFailByGestureRecognizer(UIGestureRecognizer otherGestureRecognizer)booleanshouldReceiveEvent(UIEvent event)same behavior as the equivalent delegate methodbooleanshouldRequireFailureOfGestureRecognizer(UIGestureRecognizer otherGestureRecognizer)same behavior as the equivalent delegate methods, but can be used by subclasses to define class-wide failure requirementslongstate()the current state of the gesture recognizerstatic org.moe.natj.objc.Classsuperclass_static()voidtouchesBeganWithEvent(NSSet<? extends UITouch> touches, UIEvent event)mirror of the touch-delivery methods on UIResponder UIGestureRecognizers aren't in the responder chain, but observe touches hit-tested to their view and their view's subviews UIGestureRecognizers receive touches before the view to which the touch was hit-testedvoidtouchesCancelledWithEvent(NSSet<? extends UITouch> touches, UIEvent event)voidtouchesEndedWithEvent(NSSet<? extends UITouch> touches, UIEvent event)voidtouchesEstimatedPropertiesUpdated(NSSet<? extends UITouch> touches)voidtouchesMovedWithEvent(NSSet<? extends UITouch> touches, UIEvent event)static longversion_static()UIViewview()the view the gesture is attached to. set by adding the recognizer to a UIView using the addGestureRecognizer: method-
Methods inherited from class apple.NSObject
accessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKey
-
-
-
-
Method Detail
-
accessInstanceVariablesDirectly
public static boolean accessInstanceVariablesDirectly()
-
alloc
public static UIGestureRecognizer alloc()
-
allocWithZone
public static java.lang.Object allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
-
automaticallyNotifiesObserversForKey
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
-
cancelPreviousPerformRequestsWithTarget
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
-
cancelPreviousPerformRequestsWithTargetSelectorObject
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)
-
classFallbacksForKeyedArchiver
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
-
classForKeyedUnarchiver
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
-
debugDescription_static
public static java.lang.String debugDescription_static()
-
description_static
public static java.lang.String description_static()
-
hash_static
public static long hash_static()
-
instanceMethodForSelector
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
-
instanceMethodSignatureForSelector
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
-
instancesRespondToSelector
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
-
isSubclassOfClass
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
-
keyPathsForValuesAffectingValueForKey
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
-
new_objc
public static java.lang.Object new_objc()
-
resolveClassMethod
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
-
resolveInstanceMethod
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
-
setVersion_static
public static void setVersion_static(long aVersion)
-
superclass_static
public static org.moe.natj.objc.Class superclass_static()
-
version_static
public static long version_static()
-
addTargetAction
public void addTargetAction(java.lang.Object target, org.moe.natj.objc.SEL action)add a target/action pair. you can call this multiple times to specify multiple target/actions
-
allowedPressTypes
public NSArray<? extends NSNumber> allowedPressTypes()
Array of UIPressTypes as NSNumbers.
-
allowedTouchTypes
public NSArray<? extends NSNumber> allowedTouchTypes()
Array of UITouchTypes as NSNumbers.
-
cancelsTouchesInView
public boolean cancelsTouchesInView()
default is YES. causes touchesCancelled:withEvent: or pressesCancelled:withEvent: to be sent to the view for all touches or presses recognized as part of this gesture immediately before the action method is called.
-
delaysTouchesBegan
public boolean delaysTouchesBegan()
default is NO. causes all touch or press events to be delivered to the target view only after this gesture has failed recognition. set to YES to prevent views from processing any touches or presses that may be recognized as part of this gesture
-
delaysTouchesEnded
public boolean delaysTouchesEnded()
default is YES. causes touchesEnded or pressesEnded events to be delivered to the target view only after this gesture has failed recognition. this ensures that a touch or press that is part of the gesture can be cancelled if the gesture is recognized
-
delegate
public UIGestureRecognizerDelegate delegate()
the gesture recognizer's delegate
-
init
public UIGestureRecognizer init()
-
initWithTargetAction
public UIGestureRecognizer initWithTargetAction(java.lang.Object target, org.moe.natj.objc.SEL action)
designated initializer
-
isEnabled
public boolean isEnabled()
default is YES. disabled gesture recognizers will not receive touches. when changed to NO the gesture recognizer will be cancelled if it's currently recognizing a gesture
-
setEnabled
public void setEnabled(boolean value)
default is YES. disabled gesture recognizers will not receive touches. when changed to NO the gesture recognizer will be cancelled if it's currently recognizing a gesture
-
locationInView
public CGPoint locationInView(UIView view)
a generic single-point location for the gesture. usually the centroid of the touches involved
-
locationOfTouchInView
public CGPoint locationOfTouchInView(long touchIndex, UIView view)
the location of a particular touch
-
numberOfTouches
public long numberOfTouches()
number of touches involved for which locations can be queried
-
removeTargetAction
public void removeTargetAction(java.lang.Object target, org.moe.natj.objc.SEL action)remove the specified target/action pair. passing nil for target matches all targets, and the same for actions
-
requireGestureRecognizerToFail
public void requireGestureRecognizerToFail(UIGestureRecognizer otherGestureRecognizer)
create a relationship with another gesture recognizer that will prevent this gesture's actions from being called until otherGestureRecognizer transitions to UIGestureRecognizerStateFailed if otherGestureRecognizer transitions to UIGestureRecognizerStateRecognized or UIGestureRecognizerStateBegan then this recognizer will instead transition to UIGestureRecognizerStateFailed example usage: a single tap may require a double tap to fail
-
requiresExclusiveTouchType
public boolean requiresExclusiveTouchType()
defaults to YES
-
setAllowedPressTypes
public void setAllowedPressTypes(NSArray<? extends NSNumber> value)
Array of UIPressTypes as NSNumbers.
-
setAllowedTouchTypes
public void setAllowedTouchTypes(NSArray<? extends NSNumber> value)
Array of UITouchTypes as NSNumbers.
-
setCancelsTouchesInView
public void setCancelsTouchesInView(boolean value)
default is YES. causes touchesCancelled:withEvent: or pressesCancelled:withEvent: to be sent to the view for all touches or presses recognized as part of this gesture immediately before the action method is called.
-
setDelaysTouchesBegan
public void setDelaysTouchesBegan(boolean value)
default is NO. causes all touch or press events to be delivered to the target view only after this gesture has failed recognition. set to YES to prevent views from processing any touches or presses that may be recognized as part of this gesture
-
setDelaysTouchesEnded
public void setDelaysTouchesEnded(boolean value)
default is YES. causes touchesEnded or pressesEnded events to be delivered to the target view only after this gesture has failed recognition. this ensures that a touch or press that is part of the gesture can be cancelled if the gesture is recognized
-
setDelegate_unsafe
public void setDelegate_unsafe(UIGestureRecognizerDelegate value)
the gesture recognizer's delegate
-
setDelegate
public void setDelegate(UIGestureRecognizerDelegate value)
the gesture recognizer's delegate
-
setRequiresExclusiveTouchType
public void setRequiresExclusiveTouchType(boolean value)
defaults to YES
-
state
public long state()
the current state of the gesture recognizer
-
view
public UIView view()
the view the gesture is attached to. set by adding the recognizer to a UIView using the addGestureRecognizer: method
-
name
public java.lang.String name()
name for debugging to appear in logging
-
setName
public void setName(java.lang.String value)
name for debugging to appear in logging
-
canBePreventedByGestureRecognizer
public boolean canBePreventedByGestureRecognizer(UIGestureRecognizer preventingGestureRecognizer)
-
canPreventGestureRecognizer
public boolean canPreventGestureRecognizer(UIGestureRecognizer preventedGestureRecognizer)
same behavior as the equivalent delegate methods, but can be used by subclasses to define class-wide prevention rules for example, a UITapGestureRecognizer never prevents another UITapGestureRecognizer with a higher tap count
-
ignorePressForEvent
public void ignorePressForEvent(UIPress button, UIPressesEvent event)
-
ignoreTouchForEvent
public void ignoreTouchForEvent(UITouch touch, UIEvent event)
if a touch isn't part of this gesture it can be passed to this method to be ignored. ignored touches won't be cancelled on the view even if cancelsTouchesInView is YES
-
initWithCoder
public UIGestureRecognizer initWithCoder(NSCoder coder)
-
pressesBeganWithEvent
public void pressesBeganWithEvent(NSSet<? extends UIPress> presses, UIPressesEvent event)
-
pressesCancelledWithEvent
public void pressesCancelledWithEvent(NSSet<? extends UIPress> presses, UIPressesEvent event)
-
pressesChangedWithEvent
public void pressesChangedWithEvent(NSSet<? extends UIPress> presses, UIPressesEvent event)
-
pressesEndedWithEvent
public void pressesEndedWithEvent(NSSet<? extends UIPress> presses, UIPressesEvent event)
-
reset
public void reset()
called automatically by the runtime after the gesture state has been set to UIGestureRecognizerStateEnded any internal state should be reset to prepare for a new attempt to recognize the gesture after this is received all remaining active touches will be ignored (no further updates will be received for touches that had already begun but haven't ended)
-
setState
public void setState(long value)
the current state of the gesture recognizer. can only be set by subclasses of UIGestureRecognizer, but can be read by consumers
-
shouldBeRequiredToFailByGestureRecognizer
public boolean shouldBeRequiredToFailByGestureRecognizer(UIGestureRecognizer otherGestureRecognizer)
-
shouldRequireFailureOfGestureRecognizer
public boolean shouldRequireFailureOfGestureRecognizer(UIGestureRecognizer otherGestureRecognizer)
same behavior as the equivalent delegate methods, but can be used by subclasses to define class-wide failure requirements
-
touchesBeganWithEvent
public void touchesBeganWithEvent(NSSet<? extends UITouch> touches, UIEvent event)
mirror of the touch-delivery methods on UIResponder UIGestureRecognizers aren't in the responder chain, but observe touches hit-tested to their view and their view's subviews UIGestureRecognizers receive touches before the view to which the touch was hit-tested
-
touchesCancelledWithEvent
public void touchesCancelledWithEvent(NSSet<? extends UITouch> touches, UIEvent event)
-
touchesEndedWithEvent
public void touchesEndedWithEvent(NSSet<? extends UITouch> touches, UIEvent event)
-
touchesEstimatedPropertiesUpdated
public void touchesEstimatedPropertiesUpdated(NSSet<? extends UITouch> touches)
-
touchesMovedWithEvent
public void touchesMovedWithEvent(NSSet<? extends UITouch> touches, UIEvent event)
-
buttonMask
public long buttonMask()
-
modifierFlags
public long modifierFlags()
Values from the last event processed. These values are not considered as requirements for the gesture.
-
shouldReceiveEvent
public boolean shouldReceiveEvent(UIEvent event)
same behavior as the equivalent delegate method
-
-