             return false
         }
     }
-
+    
     open override func invalidationContext(forBoundsChange newBounds: CGRect) -> UICollectionViewLayoutInvalidationContext {
         let context = super.invalidationContext(forBoundsChange: newBounds)
         guard let flowLayoutContext = context as? UICollectionViewFlowLayoutInvalidationContext else { return context }

        return messagesDataSource
    }

    fileprivate var messagesLayoutDelegate: MessagesLayoutDelegate {
        guard let messagesLayoutDelegate = messagesCollectionView.messagesLayoutDelegate else {
            fatalError("MessagesLayoutDeleagte has not been set.")

        }
    }

    /// Determines the maximum number of `MessageCollectionViewCell` attributes to cache.
    ///
    /// The default value of this property is 500.
    open var attributesCacheMaxSize: Int = 500
    
    /// A type property representing the `MessagesCollectionViewLayoutAttributes` to be used.
    open override class var layoutAttributesClass: AnyClass {
        return MessagesCollectionViewLayoutAttributes.self
    }
    
    // MARK: - Properties [Private]
    
    /// Font to be used by `TextMessageCell` for `MessageData.emoji(String)` case.
    ///
    /// The default value of this property is 2x the `messageLabelFont`.
    private var emojiLabelFont: UIFont

    /// The cache for `MessageIntermediateLayoutAttributes`.
    /// The key is the `messageId` of the `MessageType`.
    fileprivate var intermediateAttributesCache: [MessageID: MessageIntermediateLayoutAttributes] = [:]
    typealias MessageID = String
    
    /// Convenience property for accessing the layout object's `MessagesCollectionView`.
    fileprivate var messagesCollectionView: MessagesCollectionView {
        guard let messagesCollectionView = collectionView as? MessagesCollectionView else {
            fatalError("MessagesCollectionViewFlowLayout is being used on a foreign type.")
