You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expand ASExperimentalRangeUpdateOnChangesetUpdate to ASTableView (TextureGroup#1979)
A previous commit
(TextureGroup@8f7444e)
aimed to fix a preloading bug for ASCollectionView. This commit expands this
fix to ASTableView as the bug occurs there too.
Previous commit message for context:
This experiment makes sure a ASCollectionView's `rangeController` updates when
a changeset WITH updates is applied. Currently it is possible for nodes
inserted into the preload range to not get preloaded when performing a batch
update.
For example, suppose a collection node has:
- Tuning parameters with a preload range of 1 screenful for the given range
mode.
- Nodes A and B where A is visible and B is off screen.
Currently if node B is deleted and a new node C is inserted in its place, node
C will not get preloaded until the collection node is scrolled. This is because
the preloading mechanism relies on a `setNeedsUpdate` call on the range
controller as part of the `-collectionView:willDisplayCell:forItemAtIndexPath:`
delegate method when the batch update is submitted. However, in the example
outlined above, this sometimes doesn't happen automtically, causing the range
update to be delayed until the next the view scrolls.
XCTAssertTrue(dataSource.numberOfSections > nextItemSection, @"There is no items after the last visible item. Update the section/row counts so that there is one for this test to work properly.");
831
+
XCTAssertTrue(dataSource.rowsPerSection > nextItemRow, @"There is no items after the last visible item. Update the section/row counts so that there is one for this test to work properly.");
XCTestExpectation *noChangeDone = [selfexpectationWithDescription:@"Batch update with no changes done and completion block has been called. Tuning params set to 1 screenful."];
XCTAssertTrue(nodeBeforeUpdate == nodeAfterUpdate, @"Node should not have changed since no updates were made.");
848
+
XCTAssertTrue(nodeAfterUpdate.didEnterPreloadStateCount == 1, @"Node should have been preloaded.");
849
+
850
+
XCTestExpectation *changeDone = [selfexpectationWithDescription:@"Batch update with changes done and completion block has been called. Tuning params set to 1 screenful."];
XCTestExpectation *changeDoneZeroSreenfuls = [selfexpectationWithDescription:@"Batch update with changes done and completion block has been called. Tuning params set to 0 screenful."];
0 commit comments