[ASDataController] Call All Completion Handlers after Nested Batch Updates (#2274)

* Add tests for batch update completion handler calling

* Ensure we call all completion handlers after collection view updates

* Tweak it

* Fix the doc

* Minor improvements

* Document addCompletionHandler better
This commit is contained in:
Adlai Holler
2016-09-27 17:21:28 -04:00
committed by GitHub
parent 416d8f92e1
commit ec64b9b229
7 changed files with 147 additions and 10 deletions

View File

@@ -128,7 +128,7 @@ NS_ASSUME_NONNULL_BEGIN
* Boolean parameter that contains the value YES if all of the related animations completed successfully or
* NO if they were interrupted. This parameter may be nil. If supplied, the block is run on the main thread.
*/
- (void)performBatchAnimated:(BOOL)animated updates:(void (^ _Nullable)())updates completion:(void (^ _Nullable)(BOOL))completion;
- (void)performBatchAnimated:(BOOL)animated updates:(nullable __attribute((noescape)) void (^)())updates completion:(nullable void (^)(BOOL finished))completion;
/**
* Perform a batch of updates asynchronously. This method must be called from the main thread.
@@ -139,7 +139,7 @@ NS_ASSUME_NONNULL_BEGIN
* Boolean parameter that contains the value YES if all of the related animations completed successfully or
* NO if they were interrupted. This parameter may be nil. If supplied, the block is run on the main thread.
*/
- (void)performBatchUpdates:(void (^ _Nullable)())updates completion:(void (^ _Nullable)(BOOL))completion;
- (void)performBatchUpdates:(nullable __attribute((noescape)) void (^)())updates completion:(nullable void (^)(BOOL finished))completion;
/**
* Reload everything from scratch, destroying the working range and all cached nodes.
@@ -148,7 +148,7 @@ NS_ASSUME_NONNULL_BEGIN
* the main thread.
* @warning This method is substantially more expensive than UICollectionView's version.
*/
- (void)reloadDataWithCompletion:(void (^ _Nullable)())completion;
- (void)reloadDataWithCompletion:(nullable void (^)())completion;
/**
* Reload everything from scratch, destroying the working range and all cached nodes.