21

I'm using UIPinchGestureRecognizer on view, now I have a requirement of knowing whether pinch-in is performed or pinch-out is performed in my selector method. Either of 1 among at a time. Please give me some idea to obtain this. Thank you.

Hemang
  • 26,840
  • 19
  • 119
  • 186
Kumaran
  • 687
  • 6
  • 14

1 Answers1

52

Use the .scale property on the gesture:

  • >1 pinch out
  • <1 pinch in
Hemang
  • 26,840
  • 19
  • 119
  • 186
Steve Rogers
  • 1,963
  • 2
  • 17
  • 25
  • 2
    For clarity here, as it was a bit confusing to me at first: ``scale > 1 = zoom in`` ``scale < 1 = zoom out`` – Mike Apr 06 '17 at 21:23