UIPanGestureRecognizer - Avoid moving two images simultaneously - Swift

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



UIPanGestureRecognizer - Avoid moving two images simultaneously - Swift



I have a ViewController with 3 UIImageView with its images. I am using Pinch, Pan and Rotate gesture on all three images. While doing Pinch or Rotation i got two finger point with opt+mouse_click. There in the finger point, if two images are pointed with each finger point, both images are moving around.



I actually don't want that move(pan) while doing opt+mouse_click, just need to rotate or zoom the images with two finger points.



Help me to resolve, Thanks in advance





Did you try using the requiredToFail delegate?
– Rakesha Shastri
Aug 8 at 5:32


requiredToFail




1 Answer
1



You can try to limit the UIPanGestureRecognizer 's finger that touch on screen to 1 to avoid it. Rotate or zoom will need 2 fingers.


UIPanGestureRecognizer



More information from Apple's doc



The maximum number of fingers that can be touching the view for this gesture to be recognized.



https://developer.apple.com/documentation/uikit/uipangesturerecognizer/1621208-maximumnumberoftouches





I understand the maximum number of fingers concept, but in my case each two fingers placed on each two images, so the maximum number of fingers is still 1 for each image which i cant able to resolve. I am trying to find the first imageview in which the finger is placed first, so that i can avoid the other image from moving
– user2941556
Aug 6 at 10:08







By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

Creating a leaderboard in HTML/JS