Skip to content
This repository was archived by the owner on Aug 14, 2019. It is now read-only.

Commit 23bf3f0

Browse files
michaelkirkjessesquires
authored andcommitted
Fix issue #1583: Don't highlight cell outside message bubble (when long press) (#1744)
In summary, overriden "touchesBegan" gaining all touch control of the JSQMessagesCollectionViewCell touches
1 parent e4927be commit 23bf3f0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

JSQMessagesViewController/Views/JSQMessagesCollectionViewCell.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,12 +212,14 @@ - (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttribut
212212
- (void)setHighlighted:(BOOL)highlighted
213213
{
214214
[super setHighlighted:highlighted];
215+
self.avatarImageView.highlighted = highlighted;
215216
self.messageBubbleImageView.highlighted = highlighted;
216217
}
217218

218219
- (void)setSelected:(BOOL)selected
219220
{
220221
[super setSelected:selected];
222+
self.avatarImageView.highlighted = selected;
221223
self.messageBubbleImageView.highlighted = selected;
222224
}
223225

@@ -247,6 +249,9 @@ - (BOOL)respondsToSelector:(SEL)aSelector
247249
return [super respondsToSelector:aSelector];
248250
}
249251

252+
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
253+
}
254+
250255
- (void)forwardInvocation:(NSInvocation *)anInvocation
251256
{
252257
if ([jsqMessagesCollectionViewCellActions containsObject:NSStringFromSelector(anInvocation.selector)]) {
@@ -383,7 +388,7 @@ - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceive
383388
return CGRectContainsPoint(self.messageBubbleContainerView.frame, touchPt);
384389
}
385390

386-
return YES;
391+
return NO;
387392
}
388393

389394
@end

0 commit comments

Comments
 (0)