         let inputHeightWithKeyboard = self.view.bounds.height - self.inputBarContainer.frame.minY
         let newInsetBottom = self.layoutConfiguration.contentInsets.bottom + inputHeightWithKeyboard
         let insetBottomDiff = newInsetBottom - collectionView.contentInset.bottom
-        var newInsetTop = self.view.safeAreaInsets.top + self.layoutConfiguration.contentInsets.top
+        let newInsetTop = self.view.safeAreaInsets.top + self.layoutConfiguration.contentInsets.top
         let contentSize = collectionView.collectionViewLayout.collectionViewContentSize
         let prevContentOffsetY = collectionView.contentOffset.y
 


    public let messagesViewController: ChatMessagesViewControllerProtocol
    public let configuration: Configuration
    let presentersByCell = NSMapTable<UICollectionViewCell, AnyObject>(keyOptions: .weakMemory, valueOptions: .weakMemory)

    public weak var keyboardEventsHandler: KeyboardEventsHandling?
    public weak var scrollViewEventsHandler: ScrollViewEventsHandling?

    open func createChatInputView() -> UIView {
        assert(false, "Override in subclass")
        return UIView()
    }

    open func didPassThreshold(at: IndexPath) {
