Get historcial points ios

2019-09-06 17:26发布

Is there any function or algorithm to catch all the points when drawing in iPhone? Like in Android, where we have gethistoical points.

1条回答
可以哭但决不认输i
2楼-- · 2019-09-06 17:45

Check the methods touchesBegan:withEvent:, touchesMoved:withEvent:, touchesEnded:withEvent: and touchesCancelled:withEvent: to detect movements

For example using the method -touchesMoved:withEvent:

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
    UITouch *touch = [touches anyObject];
    CGPoint currentPosition = [touch locationInView:self.view];
    NSLog(@"%@", NSStringFromCGPoint(currentPosition));
}

For more info check the documentation of the UIResponder class

查看更多
登录 后发表回答