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

Commit

Permalink
Fix issue #1583: Don't highlight cell outside message bubble (when lo…
Browse files Browse the repository at this point in the history
…ng press) (#1744)

In summary, overriden "touchesBegan" gaining all touch control of the JSQMessagesCollectionViewCell touches
  • Loading branch information
michaelkirk authored and jessesquires committed Jul 21, 2016
1 parent e4927be commit 23bf3f0
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,14 @@ - (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttribut
- (void)setHighlighted:(BOOL)highlighted
{
[super setHighlighted:highlighted];
self.avatarImageView.highlighted = highlighted;
self.messageBubbleImageView.highlighted = highlighted;
}

- (void)setSelected:(BOOL)selected
{
[super setSelected:selected];
self.avatarImageView.highlighted = selected;
self.messageBubbleImageView.highlighted = selected;
}

Expand Down Expand Up @@ -247,6 +249,9 @@ - (BOOL)respondsToSelector:(SEL)aSelector
return [super respondsToSelector:aSelector];
}

-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
}

- (void)forwardInvocation:(NSInvocation *)anInvocation
{
if ([jsqMessagesCollectionViewCellActions containsObject:NSStringFromSelector(anInvocation.selector)]) {
Expand Down Expand Up @@ -383,7 +388,7 @@ - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceive
return CGRectContainsPoint(self.messageBubbleContainerView.frame, touchPt);
}

return YES;
return NO;
}

@end

0 comments on commit 23bf3f0

Please sign in to comment.