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

后端 未结 5 1443
余生分开走
余生分开走 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 03:57

    try adding this to the viewdidappear method. this might fix the issue. it happened with me as well but i got this code from stack overflow that fixed my issue. hope it helps you too

    let window = view.window!
    let gr0 = window.gestureRecognizers![0] as UIGestureRecognizer
    let gr1 = window.gestureRecognizers![1] as UIGestureRecognizer
    gr0.delaysTouchesBegan = false
    gr1.delaysTouchesBegan = false
    

提交回复
热议问题