         navigationController?.navigationBar.tintColor = UIColor(rgb: 0x5B5B5B, alphaVal: 1)
 
         collectionView?.isPrefetchingEnabled = true
+        collectionView?.keyboardDismissMode = .interactive
 
         isInverted = false
         bounces = true

    }

    fileprivate func registerCells() {
        collectionView?.register(UINib(
            nibName: "ChatLoaderCell",
            bundle: Bundle.main
        ), forCellWithReuseIdentifier: ChatLoaderCell.identifier)

        collectionView?.register(UINib(
            nibName: "ChatMessageCell",
            bundle: Bundle.main
        ), forCellWithReuseIdentifier: ChatMessageCell.identifier)

        collectionView?.register(UINib(
            nibName: "ChatMessageDaySeparator",
            bundle: Bundle.main
        ), forCellWithReuseIdentifier: ChatMessageDaySeparator.identifier)

        collectionView?.register(UINib(
            nibName: "ChatMessageUnreadSeparator",
            bundle: Bundle.main
        ), forCellWithReuseIdentifier: ChatMessageUnreadSeparator.identifier)

        collectionView?.register(UINib(
            nibName: "ChatChannelHeaderCell",
            bundle: Bundle.main
        ), forCellWithReuseIdentifier: ChatChannelHeaderCell.identifier)

        collectionView?.register(UINib(
            nibName: "ChatDirectMessageHeaderCell",
            bundle: Bundle.main
        ), forCellWithReuseIdentifier: ChatDirectMessageHeaderCell.identifier)

        autoCompletionView.register(UINib(
            nibName: "AutocompleteCell",
            bundle: Bundle.main
        ), forCellReuseIdentifier: AutocompleteCell.identifier)

        autoCompletionView.register(UINib(
            nibName: "EmojiAutocompleteCell",
            bundle: Bundle.main
        ), forCellReuseIdentifier: EmojiAutocompleteCell.identifier)
    }

    internal func scrollToBottom(_ animated: Bool = false) {

extension ChatViewController {
    override func scrollViewDidScroll(_ scrollView: UIScrollView) {
        super.scrollViewDidScroll(scrollView)
        
        updateKeyboardConstraints()

        if scrollView.contentOffset.y < -10 {
            if let message = dataController.oldestMessage() {
