I have a viewController that has a UIView as a subview, I was wondering how i might tell if and only if the user has clicked on the UIView from the Viewcontroller.
Is this possible?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Check out the UITapGestureRecognizer documentation:
http://developer.apple.com/library/ios/#documentation/uikit/reference/UITapGestureRecognizer_Class/Reference/Reference.html
You’ll instantiate a UITapGestureRecognizer in your UIViewController, using initWithTarget:action (passing a selector which will handle your tap). Then add the UIGestureRecognizer to your UIView via the addGestureRecognizer method.