UIPinchGestureRecogniser
has a property
called scale
which is the scale
factor between the CGPoints
of two touches. You can make use of this property.
Add this code in your handlePinch: selector method
-(void)handlePinch:(UIPinchGestureRecognizer*)sender {
sender.view.transform = CGAffineTransformScale(sender.view.transform,
sender.scale,
sender.scale);
sender.scale = 1.0;
}
As given in the documentation,
The scale value is an absolute value that varies over time. It is not the delta value from ?the last time that the scale was reported. Apply the scale value to the state of the view when the gesture is first recognized—do not concatenate the value each time the handler is called.
So we need to reset the scale value to 1.0 .