mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Fix conversation screen scrolling issue
This commit is contained in:
parent
0348289561
commit
f5ddd697f1
|
@ -11,7 +11,7 @@
|
|||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface OWSMessageCell ()
|
||||
@interface OWSMessageCell () <UIGestureRecognizerDelegate>
|
||||
|
||||
// The nullable properties are created as needed.
|
||||
// The non-nullable properties are so frequently used that it's easier
|
||||
|
@ -81,6 +81,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
|
||||
UIPanGestureRecognizer *pan =
|
||||
[[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePanGesture:)];
|
||||
pan.delegate = self;
|
||||
[self.contentView addGestureRecognizer:pan];
|
||||
}
|
||||
|
||||
|
@ -497,6 +498,17 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
[self.messageBubbleView handlePanGesture:sender];
|
||||
}
|
||||
|
||||
-(BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
|
||||
{
|
||||
LKVoiceMessageView *voiceMessageView = self.viewItem.lastAudioMessageView;
|
||||
if (![gestureRecognizer isKindOfClass:UIPanGestureRecognizer.class] || voiceMessageView == nil) { return NO; }
|
||||
UIPanGestureRecognizer *panGestureRecognizer = (UIPanGestureRecognizer *)gestureRecognizer;
|
||||
CGPoint location = [panGestureRecognizer locationInView:voiceMessageView];
|
||||
if (!CGRectContainsPoint(voiceMessageView.bounds, location)) { return NO; }
|
||||
CGPoint velocity = [panGestureRecognizer velocityInView:voiceMessageView];
|
||||
return fabs(velocity.x) > fabs(velocity.y);
|
||||
}
|
||||
|
||||
- (BOOL)isGestureInCellHeader:(UIGestureRecognizer *)sender
|
||||
{
|
||||
OWSAssertDebug(self.viewItem);
|
||||
|
|
Loading…
Reference in a new issue