Is it possible to recreate User Gestures in iPhone?

Posted by MadhavanRP on Stack Overflow See other posts from Stack Overflow or by MadhavanRP
Published on 2011-11-12T09:18:04Z Indexed on 2011/11/12 9:50 UTC
Read the original article Hit count: 243

I am developing an app and I have encountered a problem that comes down to this scenario: Consider a superview with two buttons(button1,button2) and a text view, all as its subviews. When I click on one button, I display the text view. When I tap on anywhere outside the textview, but in the super view, I need to dismiss the text view.

I have added a UITapGestureRecognizer to the super view and it calls a method tap:. In tap:, I get the point of the tap and if it is outside the text view, I dismiss the text view and remove the GestureRecognizer. Now the problem occurs when I tap on button 2. I need to dismiss the text view as well as execute the action for button 2. But it enters tap: and I do not wish to call the button 2's method from there.

What I want to know is if it would be possible to emulate the same tap at the same co ordinates after the gesture recognizer is removed? If not what is the way I proceed to solve this issue?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c