-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add debugDescriptionLines for new updater
Summary: The current `IGListAdapterUpdater` implements `-debugDescriptionLines` which is used by `IGListDebugger` to dump information about all the apaters, so lets also implement it for `IGListExperimentalAdapterUpdater`. Reviewed By: lorixx Differential Revision: D25884781 fbshipit-source-id: 86b227258f033f0079058af04915171d6a149241
- Loading branch information
1 parent
329a4d3
commit 3b47aa2
Showing
2 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
Source/IGListKit/Internal/IGListExperimentalAdapterUpdater+DebugDescription.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#import <IGListKit/IGListExperimentalAdapterUpdater.h> | ||
|
||
@interface IGListExperimentalAdapterUpdater (DebugDescription) | ||
|
||
- (NSArray<NSString *> *)debugDescriptionLines; | ||
|
||
@end |
53 changes: 53 additions & 0 deletions
53
Source/IGListKit/Internal/IGListExperimentalAdapterUpdater+DebugDescription.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#import "IGListExperimentalAdapterUpdater+DebugDescription.h" | ||
|
||
#import "IGListBatchUpdateData+DebugDescription.h" | ||
#import "IGListDebuggingUtilities.h" | ||
#import "IGListExperimentalAdapterUpdaterInternal.h" | ||
#import "IGListUpdateTransactable.h" | ||
|
||
@implementation IGListExperimentalAdapterUpdater (DebugDescription) | ||
|
||
- (NSArray<NSString *> *)debugDescriptionLines { | ||
NSMutableArray *debug = [NSMutableArray new]; | ||
#if defined(IGLK_DEBUG_DESCRIPTION_ENABLED) && IGLK_DEBUG_DESCRIPTION_ENABLED | ||
[debug addObject:@"Options:"]; | ||
NSArray<NSString *> *options = @[ | ||
[NSString stringWithFormat:@"sectionMovesAsDeletesInserts: %@", IGListDebugBOOL(self.sectionMovesAsDeletesInserts)], | ||
[NSString stringWithFormat:@"singleItemSectionUpdates: %@", IGListDebugBOOL(self.singleItemSectionUpdates)], | ||
[NSString stringWithFormat:@"preferItemReloadsForSectionReloads: %@", IGListDebugBOOL(self.preferItemReloadsForSectionReloads)], | ||
[NSString stringWithFormat:@"allowsBackgroundReloading: %@", IGListDebugBOOL(self.allowsBackgroundReloading)], | ||
[NSString stringWithFormat:@"allowsReloadingOnTooManyUpdates: %@", IGListDebugBOOL(self.allowsReloadingOnTooManyUpdates)] | ||
]; | ||
[debug addObjectsFromArray:IGListDebugIndentedLines(options)]; | ||
|
||
const IGListBatchUpdateState state = self.transaction ? [self.transaction state] : IGListBatchUpdateStateIdle; | ||
|
||
NSString *stateString; | ||
switch (state) { | ||
case IGListBatchUpdateStateIdle: | ||
stateString = @"Idle"; | ||
break; | ||
case IGListBatchUpdateStateQueuedBatchUpdate: | ||
stateString = @"Queued batch update"; | ||
break; | ||
case IGListBatchUpdateStateExecutedBatchUpdateBlock: | ||
stateString = @"Executed batch update block"; | ||
break; | ||
case IGListBatchUpdateStateExecutingBatchUpdateBlock: | ||
stateString = @"Executing batch update block"; | ||
break; | ||
} | ||
[debug addObject:[NSString stringWithFormat:@"State: %@", stateString]]; | ||
|
||
#endif // #if IGLK_DEBUG_DESCRIPTION_ENABLED | ||
return debug; | ||
} | ||
|
||
@end |