开发者

Is there a way to fake a real touch into iPhone OS?

开发者 https://www.devze.com 2022-12-11 14:39 出处:网络
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

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 somet开发者_运维技巧hing legal.


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
   }
}   


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?

0

精彩评论

暂无评论...
验证码 换一张
取 消