I want to create a small drawing application for children. I do not want to implement a multitouch drawing application so I set: multipleTouchEnabled to false for the drawing view.
The drawing works ok so far, but when the kid touches the view with a second finger the touchesMoved-eventhandler of the view is called:
- (void) touchesMoved: (NSSet *) touches withEvent: (UIEvent *)event{
UITouch *touch = [[event allTouches] anyObject];
CGPoint touchPoint = [touch locationInView:self];
//Draw a line from the last touchPoint to here…
}
By this when the kid touches the screen with a second finger a line is drawn from the first finger to the second finger which is not intended.
Is there any way to prevent this?
Any help will be appreciated
I had this problem also. You will either have to
A) Make a check that only allows a touch to be moved a certain distance.
B) Cancel all touches when a second touch is detected (re-enable multipleTouch)
Otherwise, a second finger in single touch mode looks the same as a moved touch to the system.