Skip to content

Commit e44a985

Browse files
kerryknightColinEberhardt
authored andcommitted
Fix to CEHorizontalSwipeInteractionController when UIPanGestureRecognizer translation.x == 0
Sometimes handleGesture: incorrectly sets the BOOL rightToLeftSwipe to false when it should be true…This is due to [gestureRecognizer translationInView:gestureRecognizer.view.superview] sporadically returning {0, 0}; usually this occurs when making slow, methodical movement swipes while starting at center of view window. Solution is to break anytime {0, 0} is returned (where translation.x == 0) so that nothing happens.
1 parent be944dd commit e44a985

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

InteractionControllers/CEHorizontalSwipeInteractionController.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ - (void)handleGesture:(UIPanGestureRecognizer*)gestureRecognizer {
4242
switch (gestureRecognizer.state) {
4343
case UIGestureRecognizerStateBegan: {
4444

45+
if (translation.x == 0) break;//if no horizontal translation returned, simply break and do nothing
46+
4547
BOOL rightToLeftSwipe = translation.x < 0;
4648

4749
// perform the required navigation operation ...

0 commit comments

Comments
 (0)