 import KeyboardMan
 import Navi
 import MonkeyKing
+import Ruler
 
 struct MessageNotification {
     static let MessageStateChanged = "MessageStateChangedNotification"

        view.tintAdjustmentMode = .Normal

        if let indexOfSearchedMessage = indexOfSearchedMessage {
            displayedMessagesRange = NSRange(location: indexOfSearchedMessage, length: messages.count - indexOfSearchedMessage)

        } else {
            if messages.count >= messagesBunchCount {

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

            if let indexOfSearchedMessage = indexOfSearchedMessage {
                let index = indexOfSearchedMessage - displayedMessagesRange.location
                let indexPath = NSIndexPath(forItem: index, inSection: Section.Message.rawValue)
                conversationCollectionView.scrollToItemAtIndexPath(indexPath, atScrollPosition: .CenteredVertically, animated: false)

            } else {
                // 尽量滚到底部
                tryScrollToBottom()
            }
