How can I get the touch event?
1 answer
Take a look at the -touchesBegan, -touchesMoved and -touchesEnded methods of the UIView class - you'll want to subclass this and override these methods. Each of these provides you with an NSSet of UITouch objects; if you are not dealing with multitouch, you can get touch object by calling -anyObject on set. Then call -locationInView: with the view itself (or another view where you want the coordinates to be relative).
+1
source to share