Reputation: 1592
I have two views. A base view "View A" and its subview "View B"
I implemented tap gesture on View A and I want to enable that gesture only on View B, not View A which has actual gesture implementation.
View B may be transformed by GCAffineTransform( angle may be set ).
Upvotes: 0
Views: 169
Reputation: 254
Make class conforming to UIGestureRecognizerDelegate.
Then make self as the UITapGestureRecognizer delegate.
Implement the below method.
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(nonnull UITouch *)touch {
if (touch.view.tag == tagOfBlueView) {
return YES;
}
return NO;
}
Upvotes: 2