您的位置:首页 > 其它

在cell上添加长按手势,并给手势添加tag值

2016-07-02 09:00 204 查看
1、在cell上添加长按手势;

UILongPressGestureRecognizer *longPressGR = [[UILongPressGestureRecognizer
alloc]
initWithTarget:self
action:@selector(longPress:)];

longPressGR.minimumPressDuration =
0.5;

[cell addGestureRecognizer:longPressGR];

2、将手势添加到cell上之后在设置手势的tag值;

longPressGR.view.tag = indexPath.row;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  GestureRecognizer tag