I have a UITextView
on top of that i have multiple UIView
. Any touch action on UIView
can associated to corresponding IBAction
. In my scenario double tap gesture need to be associated to UIView
's IBAction
, any other touch apart from this needs to be forwarded to the underlying UITextView
.
My code block of doing the above scenario
UITextView *textView = [[UITextView alloc] init];
UIView *subview = [[UIView alloc] init];
UITapGestureRecognizer *doubleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapDetected:)];
doubleTap.numberOfTapsRequired = 2;
[subview addGestureRecognizer:doubleTap];
[textView addSubview: subview];
I have tried the following SO solutions,
How to ignore touch events and pass them to another subview's UIControl objects?
using hitTest i'm unable to capture double tap gesture in UIViews which is present on top of UITextView
Make UIGestureRecognizer to receive touches started on subviews
forwarding UITouch
set from touchBegan:withEvent:
in UIView
to UITextView
is not giving expected default behavior of UITextView
Is there any other solutions available to address this scenario?
Thanks in advance.
This could be accomplished by:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With