Reputation: 722
As in the title, I have an UIView
sublcass with UITapGR
added to it.
In the subclass of this class I'm laying few UIButton
s on top of the view. UIButton
won't receive any touches. When i tried to see [[tapGR view] class]
it was UIButton
's parent view. Calling setCancelsTouchesInView
to NO won't help either.
Any ideas?
Upvotes: 4
Views: 1263
Reputation: 31
You can use this code to ignore the touch event for the UIButton
:
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {
if ([touch.view isKindOfClass:[UIButton class]]){
return NO;
}
return YES;
}
Upvotes: 3
Reputation: 1312
If you want to be able to click through something you can
.userInteractionEnabled = NO
Upvotes: 0