How to emulate a tap on a uiview?

DrustZ

I come to a problem... Here's it:

I add a UIGestureRecognizer to self.view (self is a UIViewController) and handle the tap event.

But I have another UIView which is a subview of self.view, and it has a reaction of "tap" gesture (touchesBegan and touchesEnded).

Problem arises : When I tap on it, because self.view intercept the gesture, the UIView can't get the event. So is there a way to emulate a "tap", or to let go naturally in the action function?

---add---

Forwarding UIGesture to views behind is a similar question, but in that case, it can pass a UIGestureRecognizer to subview.

in this case, I need to handle when the touch begins and when it ends, so it can't handle with a UIGestureRecognizer.

Or if I can adapt the functions with UIGestureRecognizer?

DrustZ

Yeah I solved it with passing it a UIGesturerecognizer, and used this method: How to replace TouchesBegan with UIGestureRecognizer

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to emulate a Tap Event in Windows Phone?

From Dev

How to trigger tap gesture recognizer of UIView programmatically

From Dev

How to trigger tap gesture recognizer of UIView programmatically

From Dev

How to disable didSelectRowAtIndexPath on UIView Tap inside custom TableViewCell?

From Dev

How to disable didSelectRowAtIndexPath on UIView Tap inside custom TableViewCell?

From Dev

UIView with Tap Gesture Segue

From Dev

UIView with Tap Gesture Segue

From Dev

Tap Gesture on animating UIView not working

From Dev

How to emulate settings page

From Dev

How to emulate the AllowAnonymousAttribute behavior?

From Dev

RxJava: how to emulate withLatestFrom?

From Dev

How to emulate pressing "%" and ";" keys

From Dev

How to emulate the super key?

From Dev

How to emulate CPUs in Java?

From Dev

How to emulate the super key?

From Dev

iOS Detect tap down and touch up of a UIView

From Dev

Remove tap recogniser for modal UIView/Partial Curl

From Dev

Remove tap recogniser for modal UIView/Partial Curl

From Dev

Pass tap gesture from UIView to underlying AVPlayer

From Dev

UIView with label + button - Tap gesture not recognized

From Dev

How to emulate Java class with GWT

From Dev

How to emulate friendship in C#?

From Dev

How to emulate event in Kendo UI

From Dev

How to emulate numpad on a PC laptop?

From Dev

How to emulate linux dir on windows

From Dev

How to emulate/replace OpenGL version?

From Dev

How to emulate intents through espresso

From Dev

How to emulate Oracle Java with OpenJDK?

From Dev

How to emulate Process Substitution in Dash?