//抽象类 特点 不能创建对象
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(imageViewrolongPress:)];
longPress.delegate = self;
//最短是1秒
longPress.minimumPressDuration = 2;
//手势View 对象 添加给UIImageView
[imgView addGestureRecognizer:longPress];
}
#pragma mark - 点击手势触发事件
-(void)imageViewrolongPress:(UISwipeGestureRecognizer *)longPress
{
if (longPress.state == UIGestureRecognizerStateEnded)
{
NSLog(@"长按手势完毕");
}
else
{
NSLog(@"长按手势进行中...");
}
}
转载请注明出处:http://blog.csdn.net/sevenquan