I am drawing a "line" using an image and the touchesMoved event. In touchesMoved, I log the current touch location in a CGPoint. After I do that, I create a UIImageView and add it as a subview to the view. If touches moved continues to be called (meaning the user continues to move their finger), it will continue to make a new UIImageView and add it as a subview, thus creating a "line". However, when I move my finger across the screen too fast, it will break up the line. In other words, touchesMoved isn't getting called every time the user moves their finger to a new location in the view. I want touchesMoved to be called EVERY time the touch location moves (even if that is only by 1 pixel) so that I get a line effect even if the user moves their finger fast. Here's the code I use:
Code:
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [touches anyObject];
currentTouch = [touch locationInView:self.view];
CGRect myImageRect = CGRectMake(currentTouch.x, currentTouch.y, 20.0f, 20.0f);
UIImageView *myImage = [[UIImageView alloc] initWithFrame:myImageRect];
[myImage setImage:[UIImage imageNamed:@"ImageUsedToCreateTheLine.png"]];
[self.view addSubview:myImage];
[myImage release];
}
Any ideas as to how I can get touchesMoved to be called every time the touch location value changes?