Refactor to see what SenderType would look like

This commit is contained in:
Nathan Tannar
2018-10-13 15:26:43 -07:00
parent 4b14db10db
commit 762f583d49
13 changed files with 140 additions and 59 deletions
@@ -176,12 +176,12 @@ final class AdvancedExampleViewController: ChatViewController {
func isPreviousMessageSameSender(at indexPath: IndexPath) -> Bool {
guard indexPath.section - 1 >= 0 else { return false }
return messageList[indexPath.section].sender == messageList[indexPath.section - 1].sender
return messageList[indexPath.section].user == messageList[indexPath.section - 1].user
}
func isNextMessageSameSender(at indexPath: IndexPath) -> Bool {
guard indexPath.section + 1 < messageList.count else { return false }
return messageList[indexPath.section].sender == messageList[indexPath.section + 1].sender
return messageList[indexPath.section].user == messageList[indexPath.section + 1].user
}
func setTypingIndicatorHidden(_ isHidden: Bool, performUpdates updates: (() -> Void)? = nil) {