i was just searching for an appropriate event that i can catch. the pinch works well. and following line works only if there was no pinch before
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent*)event
{
NSLog(@"---> event");
}
it seems that the pinch eats up the following touch up.
anyhow in this code the touch up is recognized
- (void)scalePiece:(UIPinchGestureRecognizer *)gestureRecognizer
{
//[self adjustAncho开发者_高级运维rPointForGestureRecognizer:gestureRecognizer];
NSLog(@"scalePiece");
if ([gestureRecognizer state] == UIGestureRecognizerStateBegan || [gestureRecognizer state] == UIGestureRecognizerStateChanged) {
[gestureRecognizer view].transform = CGAffineTransformScale([[gestureRecognizer view] transform], [gestureRecognizer scale], [gestureRecognizer scale]);
[gestureRecognizer setScale:1];
}
}
how can i recognize the touch up of the last/second finger after pinching the view? or better said, how can i differentiate between pinch move and pinch end?
cheers
You can use:
if ([gestureRecognizer state] == UIGestureRecognizerStateEnded)
in your pinch function
精彩评论