This repository was archived by the owner on Feb 2, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -76,12 +76,11 @@ extern NSString * const ASCollectionInvalidUpdateException;
7676 */
7777@protocol ASDataControllerDelegate <NSObject >
7878
79- @optional
80-
8179/* *
8280 Called for batch update.
8381 */
8482- (void )dataControllerBeginUpdates : (ASDataController *)dataController ;
83+ - (void )dataControllerWillDeleteAllData : (ASDataController *)dataController ;
8584- (void )dataController : (ASDataController *)dataController endUpdatesAnimated : (BOOL )animated completion : (void (^ _Nullable)(BOOL ))completion ;
8685
8786/* *
Original file line number Diff line number Diff line change @@ -452,6 +452,7 @@ - (void)_reloadDataWithAnimationOptions:(ASDataControllerAnimationOptions)animat
452452 // -beginUpdates
453453 [_mainSerialQueue performBlockOnMainThread: ^{
454454 [_delegate dataControllerBeginUpdates: self ];
455+ [_delegate dataControllerWillDeleteAllData: self ];
455456 }];
456457
457458 // deleteSections:
Original file line number Diff line number Diff line change @@ -476,6 +476,11 @@ - (void)dataControllerBeginUpdates:(ASDataController *)dataController
476476 [_delegate didBeginUpdatesInRangeController: self ];
477477}
478478
479+ - (void )dataControllerWillDeleteAllData : (ASDataController *)dataController
480+ {
481+ [self _setVisibleNodes: nil ];
482+ }
483+
479484- (void )dataController : (ASDataController *)dataController endUpdatesAnimated : (BOOL )animated completion : (void (^)(BOOL ))completion
480485{
481486 ASDisplayNodeAssertMainThread ();
You can’t perform that action at this time.
0 commit comments