
UIButton event "Touch up inside" under Gesture is not working in my app ..

[button addTarget:self action:@selector(BtnPressed:) forControlEvents:UIControlEventTouchUpInside];

This is how you can add gesture to your UIButton instead of button action.
UILongPressGestureRecognizer * recognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleGesture:)];
recognizer.minimumPressDuration = 0.1;
[self.mButton.view addGestureRecognizer:recognizer];
[recognizer release];
- (void)handleGesture:(UIGestureRecognizer *)gestureRecognizer{
//1 = start
if(gestureRecognizer.state==1 || gestureRecognizer.state==3)[self mToggle];
//3=end
}
or simply ?
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {
if ((touch.view == yourButton)) {
return NO;
}
return YES;
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.