1 - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
 2 
 3 {
 4     NSSet *allTouch = [event allTouches];
 5     UITouch *touch = [allTouch anyObject];
 6     CGPoint point = [touch locationInView:[touch view]];
 7     int x = point.x;
 8     int y = point.y;
 9     NSLog(@"x,y == (%d, %d)", x, y);
10 }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-08
  • 2022-01-20
  • 2022-12-23
  • 2021-09-09
  • 2022-03-01
猜你喜欢
  • 2022-12-23
  • 2022-03-09
  • 2022-12-23
  • 2021-06-24
  • 2021-08-13
  • 2022-12-23
  • 2022-01-23
相关资源
相似解决方案