The distance between two fingers is enlarged or reduced.
Use-(void) touchesMoved :( NSSet *) touches withEvent :( UIEvent *) event.
TouchesMoved runs whenever the finger moves on the screen.
1. Check the number of fingers
NSArray * touchesArr = [[event allTouches] allObjects];
NSLog (@ "Number of fingers % d", [touchesArr count]);
2. Check the coordinates of the two fingers to calculate the distance between the two fingers.
P1 = [[touchesArr objectAtIndex: 0] locationInView: self. view];
P2 = [[touchesArr objectAtIndex: 1] locationInView: self. view];
3. When the calculation distance increases, the image is increased and the distance decreases. Use the frame of imageview to control the image size.
ImageView. frame = CGRectMake (imgFrame. origin. x-addwidth/2.0f, imgFrame. origin. y-addheight/2.0f, imgFrame. size. width, imgFrame. size. height );