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