Add support automatically adjusting the content offset to UITableView as well as support for performing endUpdates with no animations. Additionally, there are critical bug fixes for ASDataController (begin/end updates delegates not called in correct order) and ASRangeController (failure to fully refresh internal state when inserts or delete are made.)

This commit is contained in:
Ethan Nagel
2015-07-20 14:05:56 -07:00
parent d5086bd64f
commit f497639124
9 changed files with 255 additions and 40 deletions

View File

@@ -78,6 +78,30 @@
*/
@property (nonatomic, assign) CGFloat leadingScreensForBatching;
/**
* Perform a batch of updates asynchronously, optionally disabling all animations in the batch. You can call it from background
* thread (it is recommendated) and the UI collection view will be updated asynchronously. The asyncDataSource must be updated
* to reflect the changes before this method is called.
*
* @param animated NO to disable animations for this batch
* @param updates The block that performs the relevant insert, delete, reload, or move operations.
* @param completion A completion handler block to execute when all of the operations are finished. This block takes a single
* 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 (^)())updates completion:(void (^)(BOOL))completion;
/**
* Perform a batch of updates asynchronously. You can call it from background thread (it is recommendated) and the UI collection
* view will be updated asynchronously. The asyncDataSource must be updated to reflect the changes before this method is called.
*
* @param updates The block that performs the relevant insert, delete, reload, or move operations.
* @param completion A completion handler block to execute when all of the operations are finished. This block takes a single
* 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 (^)())updates completion:(void (^)(BOOL))completion;
/**
* Reload everything from scratch, destroying the working range and all cached nodes.
*