问题
I use on the my UIImageVIew the
-(IBAction)handlePanFrom:(UIPanGestureRecognizer *)recognizer
and in the my code I try to use a two state:
if([recognizer state] == UIGestureRecognizerStateBegan)
{
NSLog(@"Began");
}
if([recognizer state] == UIGestureRecognizerStateEnded)
{
NSLog(@"End");
}
in the console I see a "Began" message every time when I start move the UIImageView, but no any "End" message...
What I do wrong?
回答1:
from apple doc:
UIGestureRecognizerStateEnded:
The gesture recognizer has received touches recognized as the end of a continuous gesture. It sends its action message (or messages) at the next cycle of the run loop and resets its state to UIGestureRecognizerStatePossible.
plz try UIGestureRecognizerStateCancelled
来源:https://stackoverflow.com/questions/10740645/do-not-called-uigesturerecognizerstateended