UILongPressGestureRecognizer* longPressGr = [[UILongPressGestureRecognizeralloc]initWithTarget:selfaction:@selector(longPressToDo:)];
longPressGr.minimumPressDuration=3.0;
[iconImagViewaddGestureRecognizer:longPressGr];
#pragma mark长按手势
-(void)longPressToDo:(UILongPressGestureRecognizer*)gesture
{
//直接return掉,不在开始的状态里面添加任何操作,则长按手势就会被少调用一次了
if(gesture.state!=UIGestureRecognizerStateBegan)
{
return;
}
}
网友评论