1, 添加手势
self.longPressRecognizer = [[UILongPressGestureRecognizer alloc]initWithTarget:self action:@selector(handleLongPress:)];
[btn addGestureRecognizer:self.longPressRecognizer];
2,得到当前执行长点选的button
- (void)handleLongPress:(UILongPressGestureRecognizer *)recognizer
{
UIButton *btn = (UIButton *)recognizer.view;
}
给button添加长按手势并侦测到此button,布布扣,bubuko.com
原文地址:http://www.cnblogs.com/lisa090818/p/3816167.html