How do I get the coordinates for finger tapping in UIView?
(I would prefer not to use a big array of buttons)
Thank you
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.
There’re two ways to accomplish this. If you’ve already got a subclass of UIView that you’re using, you can just override the
-touchesEnded:withEvent:method on that subclass, like this:If you’re not already subclassing UIView, though, and the view is owned by a view controller or whatever, then you can use a UITapGestureRecognizer, like this: