Reputation: 9541
I am using iOS 5.x SDK and I want to determine if the screen has been tapped
For now just putting up an NSLog is fine but I don't know where to start
Upvotes: 0
Views: 1012
Reputation: 3727
You might want to start with implementing touchesBegan:withEvent:
, touchesMoved:withEvent:
, touchesEnded:withEvent:
, touchesCancelled:withEvent:
.
You can read more about it here: UIResponder Class Reference
Upvotes: 1
Reputation: 437452
Generally with gesture recognizers, e.g.,
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapOnView:)];
[self.view addGestureRecognizer:tap];
You then have a method like:
- (void)tapOnView:(UITapGestureRecognizer *)sender
{
CGPoint location = [sender locationInView:self.view];
NSLog(@"Tap at %1.0f, %1.0f", location.x, location.y);
}
Upvotes: 3