mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Beter table/collection update history (#2562)
- Introduce thread-safe ASEventLog - ASCollectionNode and ASTableNode share their event log with their ASDataController. The controller uses it to log change set submitting and finishing events. - ASCollectionNode and ASTableNode print their data source and delegate in their debug description.
This commit is contained in:
@@ -71,7 +71,7 @@ NSString * const ASDataControllerRowNodeKind = @"_ASDataControllerRowNodeKind";
|
||||
|
||||
#pragma mark - Lifecycle
|
||||
|
||||
- (instancetype)initWithDataSource:(id<ASDataControllerSource>)dataSource
|
||||
- (instancetype)initWithDataSource:(id<ASDataControllerSource>)dataSource eventLog:(ASEventLog *)eventLog
|
||||
{
|
||||
if (!(self = [super init])) {
|
||||
return nil;
|
||||
@@ -80,6 +80,10 @@ NSString * const ASDataControllerRowNodeKind = @"_ASDataControllerRowNodeKind";
|
||||
|
||||
_dataSource = dataSource;
|
||||
|
||||
#if ASEVENTLOG_ENABLE
|
||||
_eventLog = eventLog;
|
||||
#endif
|
||||
|
||||
_nodeContexts = [NSMutableDictionary dictionary];
|
||||
_completedNodes = [NSMutableDictionary dictionary];
|
||||
_editingNodes = [NSMutableDictionary dictionary];
|
||||
@@ -102,7 +106,8 @@ NSString * const ASDataControllerRowNodeKind = @"_ASDataControllerRowNodeKind";
|
||||
{
|
||||
ASDisplayNodeFailAssert(@"Failed to call designated initializer.");
|
||||
id<ASDataControllerSource> fakeDataSource = nil;
|
||||
return [self initWithDataSource:fakeDataSource];
|
||||
ASEventLog *eventLog = nil;
|
||||
return [self initWithDataSource:fakeDataSource eventLog:eventLog];
|
||||
}
|
||||
|
||||
- (void)setDelegate:(id<ASDataControllerDelegate>)delegate
|
||||
|
||||
Reference in New Issue
Block a user