`touchesBegan:withEvent:` is delayed at left edge of screen

后端 未结 5 1418
余生分开走
余生分开走 2021-01-06 03:38

I\'m experiencing an issue where the first call to touchesBegan:withEvent: on a UIView or UIViewController is delayed when you touch o

5条回答
  •  别那么骄傲
    2021-01-06 04:02

    Purteeek solution seems to work nicely in my case too. This is an objective-C implementation for SpriteKit:

    - (void)didMoveToView:(SKView *)view {
    
        UIGestureRecognizer* gr0 = view.window.gestureRecognizers[0];
        UIGestureRecognizer* gr1 = view.window.gestureRecognizers[1];
    
        gr0.delaysTouchesBegan = false;
        gr1.delaysTouchesBegan = false;
    
    }
    

    This doesn't mess with other gesture recognizers, and the system 3D Touch still works fine. I wonder why this is not the default behavior.

提交回复
热议问题