Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ - (void)triggerAction

- (void)reset
{
// TODO: On iOS 26 swiping in "wrong" direction doesn't send `onFinalize` callback. This is because now in `reset`
// default state is `UIGestureRecognizerStatePossible`
[self triggerAction]; // Keeping it will not break old iOS because we check if we do not send the same state twice.
[_gestureHandler.pointerTracker reset];
_hasBegan = NO;
[super reset];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ - (void)touchesMoved:(NSSet<RNGHUITouch *> *)touches withEvent:(UIEvent *)event
self.state = UIGestureRecognizerStateFailed;
self.enabled = NO;
self.enabled = YES;

[self triggerAction];
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ - (void)interactionsEnded:(NSSet *)touches withEvent:(UIEvent *)event
#if !TARGET_OS_TV && !TARGET_OS_OSX
[self tryUpdateStylusData:event];
#endif
[self triggerAction];
}

- (void)interactionsCancelled:(NSSet *)touches withEvent:(UIEvent *)event
Expand All @@ -201,6 +202,7 @@ - (void)interactionsCancelled:(NSSet *)touches withEvent:(UIEvent *)event
#if !TARGET_OS_TV && !TARGET_OS_OSX
[self tryUpdateStylusData:event];
#endif
[self triggerAction];
}

#if TARGET_OS_OSX
Expand Down Expand Up @@ -245,16 +247,12 @@ - (void)touchesEnded:(NSSet<RNGHUITouch *> *)touches withEvent:(UIEvent *)event
{
[super touchesEnded:touches withEvent:event];
[self interactionsEnded:touches withEvent:event];

[self triggerAction];
}

- (void)touchesCancelled:(NSSet<RNGHUITouch *> *)touches withEvent:(UIEvent *)event
{
[super touchesCancelled:touches withEvent:event];
[self interactionsCancelled:touches withEvent:event];

[self triggerAction];
}

#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ - (void)interactionsMoved:(NSSet *)touches withEvent:(UIEvent *)event

if ([self shouldFailUnderCustomCriteria]) {
self.state = UIGestureRecognizerStateFailed;
[self triggerAction];
[self reset];
return;
}
Expand All @@ -131,8 +130,6 @@ - (void)interactionsEnded:(NSSet *)touches withEvent:(UIEvent *)event

if (_numberOfTaps == _tapsSoFar && _maxNumberOfTouches >= _minPointers) {
self.state = UIGestureRecognizerStateEnded;

[self triggerAction];
[self reset];
} else {
[self performSelector:@selector(cancel) withObject:nil afterDelay:_maxDelay];
Expand All @@ -144,7 +141,6 @@ - (void)interactionsCancelled:(NSSet *)touches withEvent:(UIEvent *)event
[_gestureHandler.pointerTracker touchesCancelled:touches withEvent:event];
self.state = UIGestureRecognizerStateCancelled;

[self triggerAction];
[self reset];
}

Expand Down Expand Up @@ -204,16 +200,12 @@ - (void)touchesEnded:(NSSet<RNGHUITouch *> *)touches withEvent:(UIEvent *)event
{
[super touchesEnded:touches withEvent:event];
[self interactionsEnded:touches withEvent:event];

[self triggerAction];
}

- (void)touchesCancelled:(NSSet<RNGHUITouch *> *)touches withEvent:(UIEvent *)event
{
[super touchesCancelled:touches withEvent:event];
[self interactionsCancelled:touches withEvent:event];

[self triggerAction];
}

#endif
Expand Down Expand Up @@ -251,6 +243,10 @@ - (BOOL)shouldFailUnderCustomCriteria

- (void)reset
{
if (self.state == UIGestureRecognizerStateFailed) {
[self triggerAction];
}

[_gestureHandler.pointerTracker reset];

[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(cancel) object:nil];
Expand Down
Loading