I have two UIbuttons,and I want to implement Longpressgesture on both.
So I wrote the below code..
-(void)viewdidLoad
{
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(buttonLongPressed:)];
longPress.minimumPressDuration = 0.5;
[Button1 addGestureRecognizer:longPress];
[Button2 addGestureRecognizer:longPress];
}
- (void)buttonLongPressed:(UILongPressGestureRecognizer *)sender
{
if(sender.state == UIGestureRecognizerStateBegan)
{
}
}
now my doubt is how shall I check which button is longpresses?
Thanks Ranjit