iOS 获取当前点击的坐标

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    NSSet *allTouch = [event allTouches];
    UITouch *touch = [allTouch anyObject];
    CGPoint point = [touch locationInView:[touch view]];
    int x = point.x;
    int y = point.y;
    NSLog(@"x,y == (%d, %d)", x, y);
}
原文地址:https://www.cnblogs.com/zhangsheng-iOS/p/5714501.html