     @IBOutlet weak var buttonScrollToBottom: UIButton!
     var buttonScrollToBottomMarginConstraint: NSLayoutConstraint?
 
+    var showButtonScrollToBottom: Bool = false {
+        didSet {
+            if showButtonScrollToBottom {
+                buttonScrollToBottomMarginConstraint?.constant = -64
+            } else {
+                buttonScrollToBottomMarginConstraint?.constant = 50
+            }
+
+            if showButtonScrollToBottom != oldValue {
+                UIView.animate(withDuration: 0.5) {
+                    self.view.layoutIfNeeded()
+                }
+            }
+        }
+    }
+
     weak var chatTitleView: ChatTitleView?
     weak var chatPreviewModeView: ChatPreviewModeView?
     weak var chatHeaderViewStatus: ChatHeaderViewStatus?

            }
        }

        guard let view = buttonScrollToBottom.superview else { return }

        if chatLogIsAtBottom() {
            hideButtonScrollToBottom(animated: true)
        } else {
            if buttonScrollToBottomMarginConstraint?.constant != -64 {
                buttonScrollToBottomMarginConstraint?.constant = -64
                UIView.animate(withDuration: 0.5) {
                    view.layoutIfNeeded()
                }
            }
        }
    }
}


        let sizeHeight = collectionView?.contentSize.height ?? 0
        let offset = CGPoint(x: 0, y: max(sizeHeight - boundsHeight, 0))
        collectionView?.setContentOffset(offset, animated: animated)
        showButtonScrollToBottom = false
    }

    // MARK: SlackTextViewController
