views:

107

answers:

2

I need to fake a real touch event programmatically, so that any subsequent touch (from the users finger, for example) will immediately result into a -touchesMoved.... message rather than -touchesBegan....

Any solution how to do that? I know Three20, but I need something legal.

A: 

Is it not viable to simply set a flag to interpret the next touchesBegan event as a touchesMoved event instead, and have your own code handle figuring out what the latter event would look like?

Amber
No, there is no such flag. I tested all of these techniques. You will always end up with a 0.25 seconds delay until any touchesMoved gets called. It's a system level problem. On low level the system waits to determine if the user just wanted to touch or if he wanted to drag. Resulting in very bad user experience. You see it all over the place. Sliders for example. Now touch anywhere on screen and THEN move a slider while still touching that spot, and you will see all goes much smoother and faster! it's a real conceptional bug from Apple.
Another Registered User
I was actually referring to implementing your own flag (similar to ka1968's answer), rather than asking if something was built into the system.
Amber
A: 

I'm not sure if I got you right, but if you want touchesBegan act like touchesMoved why don't do like:

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 
{
   if(specialModeOn)//I don't know if you need this
   {
     [self touchesMoved:touches withEvent:event];
   }
   else
   {
     //whatever touchesBegan should do normally
   }
}
Kai