Redneys
Redneys

Reputation: 305

Get coordinates of touch in subview?

I am using a UIGestureRecognizer in a scroll view which is inside of my larger view controller. I need to get the coordinates of the touch, which I am not sure how to do without subclassing the scroll view. Any ideas - very much appreciate any help?

Upvotes: 1

Views: 66

Answers (1)

beyowulf
beyowulf

Reputation: 15331

In the IBAction of the gesture recognizer, cast sender to whatever type gesture recognizer you're using and say:

CGPoint location = [sender locationInView:self.viewIWantTheCoordinatesIn];

Upvotes: 2

Related Questions