Do not called UIGestureRecognizerStateEnded

浪尽此生 提交于 2019-12-13 13:24:49

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!