我必须在我的iPad应用程序中实现签名功能。我将签名转换为图像,然后我想获得该图像的坐标。我怎么能这样帮助我。
注意:我不是在谈论纬度和经度。我在谈论像素坐标
答案 0 :(得分:0)
UIViewController
是UIResponder
的子类,因此您可以实施方法touchesBegan:withEvent:
,touchesMoved:withEvent:
,touchesEnded:withEvent:
和touchesCancelled:withEvent:
来检测“签署运动“。
例如,使用方法-touchesMoved:withEvent:
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [touches anyObject];
CGPoint currentPosition = [touch locationInView:self.view];
NSLog(@"%@", NSStringFromCGPoint(currentPosition));
}
有关详情,请查看UIResponder
班级的documentation