iOS获取当前点击的坐标

原创
2016/07/28 13:47
阅读数 65
- (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);
}
展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部