我用代码添加UILongPressGestureRecognizer
了几个UIButton
:
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(btnLong:)];
[btnOne addGestureRecognizer:longPress]; //there are btnTwo, btnThree for example
当我长按一个按钮时,该方法被调用:
-(void)btnLong:(UILongPressGestureRecognizer *)gestureRecognizer{
if ([gestureRecognizer state] == UIGestureRecognizerStateBegan) {
}
}
我的问题是,我怎么知道哪个UILongPressGestureRecognizer
被触发了,因为UILongPressGestureRecognizer
.