                 newMessagesTotalHeight += height
             }
             
-            let keyboardAndToolBarHeight = self.messageToolbarBottomConstraint.constant + CGRectGetHeight(messageToolbar.bounds)
-            
-            let totleMessagesHeight = self.conversationCollectionView.contentSize.height + keyboardAndToolBarHeight + 64.0 + newMessagesTotalHeight
-            
-            let visableMessageFieldHeight = self.conversationCollectionView.frame.size.height - (keyboardAndToolBarHeight + 64.0)
-            
-            let totalMessagesContentHeight = self.conversationCollectionView.contentSize.height + keyboardAndToolBarHeight + newMessagesTotalHeight
-            
-            println("Size is \(self.conversationCollectionView.contentSize.height) \(newMessagesTotalHeight) visableMessageFieldHeight \(visableMessageFieldHeight)")
+            let keyboardAndToolBarHeight = messageToolbarBottomConstraint.constant + CGRectGetHeight(messageToolbar.bounds)
+            
+            let totleMessagesHeight = conversationCollectionView.contentSize.height + keyboardAndToolBarHeight + 64.0 + newMessagesTotalHeight
+            
+            let visableMessageFieldHeight = conversationCollectionView.frame.size.height - (keyboardAndToolBarHeight + 64.0)
+            
+            let totalMessagesContentHeight = conversationCollectionView.contentSize.height + keyboardAndToolBarHeight + newMessagesTotalHeight
+            
+            println("Size is \(conversationCollectionView.contentSize.height) \(newMessagesTotalHeight) visableMessageFieldHeight \(visableMessageFieldHeight)")
             
             //Calculate the space can be used
-            let useableSpace = visableMessageFieldHeight - self.conversationCollectionView.contentSize.height
-            
-            self.conversationCollectionView.contentSize = CGSizeMake(self.conversationCollectionView.contentSize.width, self.conversationCollectionView.contentSize.height + newMessagesTotalHeight)
-            
-            println("Size is after \(self.conversationCollectionView.contentSize.height)")
-
-            if (totleMessagesHeight > self.conversationCollectionView.frame.size.height) {
+            let useableSpace = visableMessageFieldHeight - conversationCollectionView.contentSize.height
+            
+            conversationCollectionView.contentSize = CGSizeMake(conversationCollectionView.contentSize.width, conversationCollectionView.contentSize.height + newMessagesTotalHeight)
+            
+            println("Size is after \(conversationCollectionView.contentSize.height)")
+
+            if (totleMessagesHeight > conversationCollectionView.frame.size.height) {
                 println("New Message scroll")
+
                 UIView.animateWithDuration(0.2, delay: 0.0, options: UIViewAnimationOptions.CurveEaseInOut, animations: { () -> Void in
-                    
                     if (useableSpace > 0) {
                         let contentToScroll = newMessagesTotalHeight - useableSpace
                         println("contentToScroll \(contentToScroll)")

            // 先调整一下初次的 contentInset
            setConversaitonCollectionViewOriginalContentInset()

            if currentDisplayedMessagesRange.length > 0 {
                conversationCollectionView.scrollToItemAtIndexPath(NSIndexPath(forItem: currentDisplayedMessagesRange.length - 1, inSection: 0), atScrollPosition: UICollectionViewScrollPosition.Bottom, animated: false)
            }
        }
        


        navigationController?.interactivePopGestureRecognizer.delaysTouchesBegan = false

        if messages.count >= UInt(messagesBunchCount) {
            displayedMessagesRange = NSRange(location: Int(messages.count) - messagesBunchCount, length: messagesBunchCount)
        } else {
            displayedMessagesRange = NSRange(location: 0, length: Int(messages.count))
        }

        
        let undoBarButtonItem = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.Undo, target: self, action: "undoMessageSend")
