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 }
时间: 2024-10-27 01:19:16