Skip to content

Prop for ending pinching gesture when one finger is lifted (iOS)#1391

Closed
iqqmuT wants to merge 4 commits into
software-mansion:mainfrom
iqqmuT:ios-pinch-two-pointers
Closed

Prop for ending pinching gesture when one finger is lifted (iOS)#1391
iqqmuT wants to merge 4 commits into
software-mansion:mainfrom
iqqmuT:ios-pinch-two-pointers

Conversation

@iqqmuT

@iqqmuT iqqmuT commented Feb 28, 2021

Copy link
Copy Markdown

Description

Fixes #1214.

Probably the maintainers don't want to alter the native iOS behavior with this PR, but this fork can be useful for those who want to avoid writing workarounds.

This fork adds a new boolean prop for PinchGestureHandler (iOS only): twoPointersRequired

  • false (default): no change for behavior; lets UIPinchGestureRecognizer end the gesture when the user lifts off both fingers from the view
  • true: end the gesture when the user lifts off one finger from the view

Test plan

Tested on iPhone 6s Plus.

<PinchGestureHandler twoPointersRequired={true}>
  ...
</PinchGestureHandler>

// user lifts one finger from the view.
if (_twoPointersRequired) {
self.state = UIGestureRecognizerStateEnded;
[self reset];

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if calling reset is required.

@j-piasecki

Copy link
Copy Markdown
Member

Closing this as we actually implemented the opposite in #2983

@j-piasecki j-piasecki closed this Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change Pinch Gesture Handler Behavior to transition to END state after one finger is taken off screen and one left

2 participants