About messages from UITapGestureRecognizer
The UITapGestureRecognizer
only fires when the gesture state is UIGestureRecognizerStateEnded
If you want to use a gesture recogniser to detect the start and end of a press, use the UILongPressGestureRecognizer
, with the minumumPressDuration
set to 0
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
NSDate *date1 = [NSDate date]; //user touches the screen
}
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
NSDate *date2 = [NSDate date]; //user lifts his finger away from the screen
}