 extension MessagesViewController {
     
     fileprivate func addKeyboardObservers() {
-        
+
+        NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardDidChangeState), name: .UIKeyboardDidShow, object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardDidChangeState), name: .UIKeyboardWillHide, object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardDidChangeState), name: .UIKeyboardWillShow, object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardDidChangeState), name: .UIKeyboardWillChangeFrame, object: nil)

        NotificationCenter.default.removeObserver(self, name: .UIKeyboardWillHide, object: nil)
        NotificationCenter.default.removeObserver(self, name: .UIKeyboardWillShow, object: nil)
        NotificationCenter.default.removeObserver(self, name: .UIKeyboardWillChangeFrame, object: nil)
    }

    func handleKeyboardDidChangeState(_ notification: Notification) {

        let keyboardFrame = self.view.convert(keyboardEndFrame, from: self.view.window)

        switch notification.name {
        case Notification.Name.UIKeyboardDidShow:
            // Only runs once
            messagesCollectionView.contentInset =  UIEdgeInsets(top: topLayoutGuide.length, left: 0, bottom: messageInputBar.frame.height, right: 0)
            NotificationCenter.default.removeObserver(self, name: .UIKeyboardDidShow, object: nil)
        case Notification.Name.UIKeyboardDidChangeFrame, Notification.Name.UIKeyboardWillShow:
            if (keyboardFrame.origin.y + keyboardFrame.size.height) > view.frame.size.height {
                // Hardware keyboard is found
