     weak var chatTitleView: ChatTitleView?
     weak var chatPreviewModeView: ChatPreviewModeView?
     
-    var searchResult: Results<User>?
+    var searchResult: [String] = []
     var messagesToken: NotificationToken!
     var messages: Results<Message>!
     var subscription: Subscription! {

        guard let users = try? Realm().objects(User.self) else { return }
        
        if prefix == "@" && word.characters.count > 0 {
            self.searchResult = users.filter(NSPredicate(format: "username BEGINSWITH[c] %@", word))
        }
        
        let show = (self.searchResult?.count ?? 0 > 0)
        self.showAutoCompletionView(show)
    }
    
    override func heightForAutoCompletionView() -> CGFloat {
        return AutocompleteCell.minimumHeight * CGFloat(searchResult?.count ?? 1)
    }
    
    override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return searchResult?.count ?? 0
    }
    
    override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {

    }
    
    override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        let object = searchResult[indexPath.row]
        acceptAutoCompletion(with: object, keepPrefix: true)
    }
    
    func autoCompletionCellForRowAtIndexPath(_ indexPath: IndexPath) -> AutocompleteCell {
        let object = searchResult[indexPath.row]
        let cell = autoCompletionView.dequeueReusableCell(withIdentifier: AutocompleteCell.identifier) as! AutocompleteCell
        cell.selectionStyle = .default
        
        // cell.avatarView.user = user
        cell.labelTitle.text = object
        return cell
    }
    
