     open override var shouldAutorotate: Bool {
         return false
     }
+    
+    /// A Boolean value used to determine if `viewDidLayoutSubviews()` has been called.
+    private var isFirstLayout: Bool = true
 
     // MARK: - View Life Cycle
 


// MARK: - Keyboard Handling

extension MessagesViewController {

    fileprivate func addKeyboardObservers() {
        NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardDidChangeState), name: .UIKeyboardWillChangeFrame, object: nil)
        NotificationCenter.default.addObserver(self, selector: #selector(handleTextViewDidBeginEditing), name: .UITextViewTextDidBeginEditing, object: messageInputBar.inputTextView)
    }

    fileprivate func removeKeyboardObservers() {
        NotificationCenter.default.removeObserver(self, name: .UIKeyboardWillChangeFrame, object: nil)
        NotificationCenter.default.removeObserver(self, name: .UITextViewTextDidBeginEditing, object: messageInputBar.inputTextView)
    }

        removeKeyboardObservers()
    }

    // MARK: - Methods [Private]

    /// Sets the delegate and dataSource of the messagesCollectionView property.
    private func setupDelegates() {
        messagesCollectionView.delegate = self
        messagesCollectionView.dataSource = self
    }

    /// Registers all cells and supplementary views of the messagesCollectionView property.
    private func registerReusableViews() {

        messagesCollectionView.register(TextMessageCell.self)
