获取historcial点的ios(Get historcial points ios)

2019-10-17 20:19发布

是否有任何功能或算法在绘画时抓住所有的点iPhone ? 像在Android上,在那里我们有gethistoical点。

Answer 1:

检查方法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类的



文章来源: Get historcial points ios