I created a test project showing the problem.
When I do a fast pan from the left or right edge, during the state UIGestureRecognizerState.Began
, the translationInView
is equal to (0.0, 0.0). This happens when you are in landscape
and do the gesture in the lower half of the device (iphone 6 in my case) or when you are in portrait
and do the gesture in about the 1rst third part of the screen (from the bottom).
Is it... normal? I guess it's probably know but couldn't find anything.
I don't think there's anything wrong with your code. The value returned by translationInView(_:)
is relative to the first point where the gesture began, which makes sense during the .Began
because that is immediately after that first point is established.
Also, just want to make sure you understand that you are using UIScreenEdgePanGestureRecognizer
and not some other UIPanGestureRecognizer
. The normal behavior of UIScreenEdgePanGestureRecognizer
is to only be active near the screen edges, which explains the active areas you are describing. Since you mention it, just want to make sure there's no confusion (please person me if that's not the case).