1
//
1.创建手势识别器
2 UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] init];
3// 1.1设置长按手势识别器的属性
4// longPress.minimumPressDuration = 5;
5 6// 手指按下后事件响应之前允许手指移动的偏移位 7 longPress.allowableMovement = 50;
8 910// 2.添加手势识别器到View11 [self.customView addGestureRecognizer:longPress];
1213// 3.监听手势识别器14 [longPress addTarget:self action:@selector(longPressView)];
15}
1617 -(void)longPressView
18{
19 NSLog(@"长按事件");
20 }
原文:http://www.cnblogs.com/PJHome/p/5154172.html
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!