     }
     
     
-    open override func viewDidLayoutSubviews() {
-        super.viewDidLayoutSubviews()
-        
-//        if let toobar = inputToolbar {
-//            if toolbarHeight != toobar.bounds.height {
-//                toolbarHeight = toobar.bounds.height
-//                updateMessagesViewInsets(with: keyboardEndFrame)
-//                scrollToBottom(animated: true)
-//            }
-//        }
-    }
-    
-    
-
-    
     private func configure() {
         
         #if swift(>=3.0)

    
    fileprivate func registerObservers() {
        
        NotificationCenter.default.addObserver(self, selector: #selector(didReceivePreferredContentSizeChanged(_:)), name: Notification.Name.UIContentSizeCategoryDidChange, object: nil)
        NotificationCenter.default.addObserver(self, selector: #selector(didReceiveKeyboardWillChangeFrame(_:)), name: Notification.Name.UIKeyboardWillChangeFrame, object: nil)
        
    }
    

                           animations:
                {
                    self.updateMessagesViewInsets(with: keyboardEndFrame)
                    if self.automaticallyScrollsToMostRecentMessage {
                        self.scrollToBottom(animated: true)
                    }
                    
                    
                }, completion: nil)
        }
        
    }
    
    

    
    open func didReceivePreferredContentSizeChanged(_ notification: Notification) {
        messagesView.messagesViewLayout.invalidateLayout()
        messagesView.setNeedsLayout()
    }
    
}

