A count of started touches is not equal to count of finished touches

后端 未结 5 2090
无人共我
无人共我 2021-02-07 10:10

I have the following code for testing purposes:

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    [self customTouchHandler:touches];
}

- (v         


        
5条回答
  •  说谎
    说谎 (楼主)
    2021-02-07 10:37

    I had this same problem before (touchesEnded:withEvent: is not called).

    My testing revealed that touchedEnded was not being called 100% of the time. My solution: Place the four touch handling methods in the AppDelegate.m file and forward the touches to your view controller. I have no idea why this works, but I didn't have any issues after doing that.

提交回复
热议问题