update cell after clear history

This commit is contained in:
nixzhu
2015-06-25 15:11:08 +08:00
parent f02ba95b8b
commit bbe9a2d87a
@@ -203,8 +203,18 @@ extension ConversationsViewController: UITableViewDataSource, UITableViewDelegat
let deleteAlertController = UIAlertController(title: nil, message: nil, preferredStyle: .ActionSheet)
let clearHistoryAction: UIAlertAction = UIAlertAction(title: NSLocalizedString("Clear history", comment: ""), style: .Default) { action -> Void in
clearMessages()
tableView.setEditing(false, animated: true)
// update cell
if let cell = tableView.cellForRowAtIndexPath(indexPath) as? ConversationCell {
let conversation = self.conversations[indexPath.row]
let radius = min(CGRectGetWidth(cell.avatarImageView.bounds), CGRectGetHeight(cell.avatarImageView.bounds)) * 0.5
cell.configureWithConversation(conversation, avatarRadius: radius)
}
}
deleteAlertController.addAction(clearHistoryAction)