José Joel.
José Joel.

Reputation: 2050

Differentiate pinchs from counterpinchs with UIPinchGestureRecognizer

It's possible to differientate bettwen a pinch gesture and a counterpinch gessture with UIPinchGestureRecognizer ?

And it's possible to know the angle bettwen the two fingers that perform the pinch using UIPinchGestureRecognizer ?

thanks.

Upvotes: 0

Views: 457

Answers (2)

kris
kris

Reputation: 2526

Depending on what you mean by angle, you can retrieve the CGPoint values for the pinch's touchpoints using the method 'locationOfTouch:(NSUInteger) inView:(UIView)' . From there you should be able to calculate an angle (again depending on what you mean by angle).

And as pointed out already, scale greater than or less than 1 will tell you zoom out/in.

Upvotes: 0

samkass
samkass

Reputation: 5951

The scale returned from the pinch will be less than one on a "zoom out" and greater than one on a "zoom in". There is no way to get the angle between the two fingers from the UIPinchGestureRecognizer; for that you'd have to track the touches manually.

Upvotes: 2

Related Questions