PlayerViewController+TouchPointXD.m 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. //
  2. // CloudPhoneViewController+RBDConnect.m
  3. // VclustersGemini
  4. //
  5. // Created by APPLE on 2021/8/16.
  6. // Copyright © 2021 APPLE. All rights reserved.
  7. //
  8. #import "PlayerViewController+TouchPointXD.h"
  9. @interface PlayerViewController(TouchPointXD)
  10. @end
  11. @implementation PlayerViewController(TouchPointXD)
  12. //#pragma mark ---UIResponder
  13. - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
  14. [super touchesBegan:touches withEvent:event];
  15. NSSet *allTouch = [event allTouches];
  16. UITouch *touch = [allTouch anyObject];
  17. CGPoint point = [touch locationInView:[touch view]];
  18. int x = point.x;
  19. int y = point.y;
  20. NSString *time_began = [NSString stringWithFormat:@"%zd",[iTools getNowTimeStampSS]];
  21. [HWDataManager setStringWithKey:@"XD_Began_x" value:[NSString stringWithFormat:@"%d",x]];
  22. [HWDataManager setStringWithKey:@"XD_Began_y" value:[NSString stringWithFormat:@"%d",y]];
  23. [HWDataManager setStringWithKey:@"XD_time_began" value:time_began];
  24. }
  25. - (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(nullable UIEvent *)event{
  26. [super touchesMoved:touches withEvent:event];
  27. }
  28. - (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(nullable UIEvent *)event{
  29. [super touchesEnded:touches withEvent:event];
  30. NSSet *allTouch = [event allTouches];
  31. UITouch *touch = [allTouch anyObject];
  32. CGPoint point = [touch locationInView:[touch view]];
  33. int x = point.x;
  34. int y = point.y;
  35. NSString *time_end = [NSString stringWithFormat:@"%zd",[iTools getNowTimeStampSS]];
  36. [HWDataManager setStringWithKey:@"XD_End_x" value:[NSString stringWithFormat:@"%d",x]];
  37. [HWDataManager setStringWithKey:@"XD_End_y" value:[NSString stringWithFormat:@"%d",y]];
  38. [HWDataManager setStringWithKey:@"XD_time_end_y" value:time_end];
  39. }
  40. - (void)touchesCancelled:(NSSet<UITouch *> *)touches withEvent:(nullable UIEvent *)event{
  41. [super touchesCancelled:touches withEvent:event];
  42. }
  43. @end