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:
parent
4086d458e3
commit
bdb01e4a40
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue