问题
I have an empty View-Based app. I'd like to do something with the x,y coordinates of every touch down on the screen. How do I do this?
回答1:
Override the
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
function (from the NSRespondrer class). You can override it from your view class. The 'touches' variable hold a set of 'UITouch' instances that you can query for the location in the view.
来源:https://stackoverflow.com/questions/542972/iphone-how-do-i-get-the-location-of-a-touch-down-event