Get historcial points ios

三世轮回 提交于 2019-12-13 04:26:43

问题


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


回答1:


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



来源:https://stackoverflow.com/questions/15428233/get-historcial-points-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!