Allows data source to trigger updates with concrete context. Basically this allows to trigger some updates with a non-animated reloadData while others will be animated (performBatchUpdates)

This commit is contained in:
Diego Sanchez 2016-02-09 16:13:43 +00:00
parent 4086d458e3
commit bdb01e4a40
2 changed files with 11 additions and 6 deletions

View File

@ -26,12 +26,8 @@ import Foundation
extension BaseChatViewController: ChatDataSourceDelegateProtocol {
public enum UpdateContext {
case Normal
case FirstLoad
case Pagination
case Reload
case MessageCountReduction
public func chatDataSourceDidUpdate(chatDataSource: ChatDataSourceProtocol, context: UpdateContext) {
self.enqueueModelUpdate(context: context)
}
public func chatDataSourceDidUpdate(chatDataSource: ChatDataSourceProtocol) {

View File

@ -24,8 +24,17 @@
import Foundation
public enum UpdateContext {
case Normal
case FirstLoad
case Pagination
case Reload
case MessageCountReduction
}
public protocol ChatDataSourceDelegateProtocol: class {
func chatDataSourceDidUpdate(chatDataSource: ChatDataSourceProtocol)
func chatDataSourceDidUpdate(chatDataSource: ChatDataSourceProtocol, context: UpdateContext)
}
public protocol ChatDataSourceProtocol: class {