UIPanGestureRecognizer velocity return 0 in Simulator Macbook M1
Asked Answered
P

0

9

Currently, I am building an app that contains a feature that uses a UIPanGestureRecognizer. Previously, I used an Intel Mac, and the UIPanGestureRecognizer velocity attribute is working correctly and return the expected value. However, after I switch to MacBook M1, the velocity of panGesture always returns 0.

 @objc
func panGesture(_ recognizer: UIPanGestureRecognizer) {

    view.endEditing(true)
    let translation = recognizer.translation(in: self.view)
    let velocity = recognizer.velocity(in: self.view)

   // The velocity should have a value when a gesture is happening
   //.....
} // End of PanGesture

Is there any patch or some action to make it work properly, same as with the Intel chip? I would please appreciate some suggestions to fix the issue.

FYI: Testing the app on real device, and it still working fine.

Polarize answered 17/12, 2021 at 8:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.