diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.m index d06523d3d..f4da0f6c3 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.m @@ -283,7 +283,7 @@ const CGFloat OWSMessageCellCornerRadius = 17; [self.textBubbleImageView addGestureRecognizer:textLongPress]; PanDirectionGestureRecognizer *panGesture = - [[PanDirectionGestureRecognizer alloc] initWithDirection:PanDirectionForward + [[PanDirectionGestureRecognizer alloc] initWithDirection:(self.isRTL ? PanDirectionLeft : PanDirectionRight) target:self action:@selector(handlePanGesture:)]; [self addGestureRecognizer:panGesture]; diff --git a/Signal/src/views/DirectionalPanGestureRecognizer.swift b/Signal/src/views/DirectionalPanGestureRecognizer.swift index 8e4b3b59d..926158c51 100644 --- a/Signal/src/views/DirectionalPanGestureRecognizer.swift +++ b/Signal/src/views/DirectionalPanGestureRecognizer.swift @@ -6,7 +6,7 @@ import UIKit.UIGestureRecognizerSubclass @objc enum PanDirection: Int { - case forward, backward, up, down, any + case left, right, up, down, any } @objc @@ -33,13 +33,13 @@ class PanDirectionGestureRecognizer: UIPanGestureRecognizer { let deltaX = previousLocation.x - location.x switch direction { - case .down where deltaY < 0: - return case .up where deltaY > 0: return - case .forward where deltaX < 0: + case .down where deltaY < 0: + return + case .left where deltaX > 0: return - case .backward where deltaX > 0: + case .right where deltaX < 0: return default: break @@ -52,7 +52,7 @@ class PanDirectionGestureRecognizer: UIPanGestureRecognizer { if state == .began { let vel = velocity(in: view) switch direction { - case .forward, .backward: + case .left, .right: if fabs(vel.y) > fabs(vel.x) { state = .cancelled }