About messages from UITapGestureRecognizer

前端 未结 3 548
清酒与你
清酒与你 2021-01-18 01:06

The following is from documentation :

Although taps are discrete gestures, they are discrete for each state of the gesture recognizer; thus the as

3条回答
  •  天命终不由人
    2021-01-18 01:49

    - (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
    
    }
    

提交回复
热议问题