diff --git a/JSQMessagesViewController/Layout/JSQMessagesCollectionViewFlowLayout.m b/JSQMessagesViewController/Layout/JSQMessagesCollectionViewFlowLayout.m index 65cc2d66f..47e5a1a6a 100644 --- a/JSQMessagesViewController/Layout/JSQMessagesCollectionViewFlowLayout.m +++ b/JSQMessagesViewController/Layout/JSQMessagesCollectionViewFlowLayout.m @@ -31,6 +31,9 @@ #import "JSQMessagesCollectionViewLayoutAttributes.h" #import "JSQMessagesCollectionViewFlowLayoutInvalidationContext.h" +#import "UIImage+JSQMessages.h" + + const CGFloat kJSQMessagesCollectionViewCellLabelHeightDefault = 20.0f; const CGFloat kJSQMessagesCollectionViewAvatarSizeDefault = 30.0f; @@ -74,7 +77,7 @@ - (void)jsq_configureFlowLayout self.sectionInset = UIEdgeInsetsMake(10.0f, 4.0f, 10.0f, 4.0f); self.minimumLineSpacing = 4.0f; - _bubbleImageAssetWidth = [UIImage imageNamed:@"bubble_min"].size.width; + _bubbleImageAssetWidth = [UIImage jsq_bubbleCompactImage].size.width; _messageBubbleSizes = [NSMutableDictionary new]; @@ -139,9 +142,13 @@ - (void)dealloc _messageBubbleFont = nil; + [_messageBubbleSizes removeAllObjects]; _messageBubbleSizes = nil; + [_dynamicAnimator removeAllBehaviors]; _dynamicAnimator = nil; + + [_visibleIndexPaths removeAllObjects]; _visibleIndexPaths = nil; } diff --git a/JSQMessagesViewController/Views/JSQMessagesCollectionViewCell.m b/JSQMessagesViewController/Views/JSQMessagesCollectionViewCell.m index 393f33ef1..b22c7e1ae 100644 --- a/JSQMessagesViewController/Views/JSQMessagesCollectionViewCell.m +++ b/JSQMessagesViewController/Views/JSQMessagesCollectionViewCell.m @@ -273,7 +273,7 @@ - (void)setMediaView:(UIView *)mediaView [self.messageBubbleImageView removeFromSuperview]; [self.textView removeFromSuperview]; - mediaView.translatesAutoresizingMaskIntoConstraints = NO; + [mediaView setTranslatesAutoresizingMaskIntoConstraints:NO]; mediaView.frame = self.messageBubbleContainerView.bounds; [self.messageBubbleContainerView addSubview:mediaView];