mirror of
https://github.com/wahyd4/Yep.git
synced 2026-08-12 06:16:09 +10:00
update cell after clear history
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user