问题
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