AsyncDisplayKit icon indicating copy to clipboard operation
AsyncDisplayKit copied to clipboard

Layout refresh too many times in ASTableNode and ASCollectionView in 2.2

Open rajeevwhiz opened this issue 9 years ago • 2 comments

I noticed this in my application and I am able to reproduce this in the LayoutSpecExamples-Swift example itself. Either reloadData, reloadSection, or something else is causing layout refresh and reloading table and collections 3 to 4 times as opposed to only 1. Same code works perfectly in ASDK 2.1.

Example LayoutSpecExamples-Swift (ASDK 2.2 Master) Add print in numberOfRowsInSection and nodeForRowAt methods in OverviewViewController

OverviewViewController: numberOfRowsInSection: 4
OverviewViewController: numberOfRowsInSection: 4
OverviewViewController: nodeForRowAt, indexPath = 0
OverviewCellNode: init
OverviewViewController: nodeForRowAt, indexPath = 1
OverviewCellNode: init
OverviewViewController: nodeForRowAt, indexPath = 2
OverviewCellNode: init
OverviewViewController: nodeForRowAt, indexPath = 3
OverviewCellNode: init
OverviewViewController: numberOfRowsInSection: 4
OverviewViewController: nodeForRowAt, indexPath = 0
OverviewCellNode: init
OverviewViewController: nodeForRowAt, indexPath = 1
OverviewCellNode: init
OverviewViewController: nodeForRowAt, indexPath = 2
OverviewCellNode: init
OverviewViewController: nodeForRowAt, indexPath = 3
OverviewCellNode: init
OverviewViewController: numberOfRowsInSection: 4
OverviewViewController: nodeForRowAt, indexPath = 0
OverviewCellNode: init
OverviewViewController: nodeForRowAt, indexPath = 1
OverviewCellNode: init
OverviewViewController: nodeForRowAt, indexPath = 2
OverviewCellNode: init
OverviewViewController: nodeForRowAt, indexPath = 3
OverviewCellNode: init

⁠⁠⁠⁠numberOfRowsInSection⁠⁠⁠⁠ getting called 4 times (instead of 1).. and ⁠⁠⁠⁠nodeForRowAt⁠⁠⁠⁠ is getting called 4x times .. hence ⁠⁠⁠⁠OverviewCellNode⁠⁠⁠⁠ getting initialized 12 times instead of 4!!

rajeevwhiz avatar Mar 12 '17 06:03 rajeevwhiz

In ASDK 2.1, ⁠⁠⁠⁠numberOfRowsInSection⁠⁠⁠⁠ is only called once and only 4 instances of ⁠⁠⁠⁠OverviewCellNode⁠⁠⁠⁠ are created

rajeevwhiz avatar Mar 12 '17 06:03 rajeevwhiz

This issue was moved to TextureGroup/Texture#201

garrettmoon avatar May 01 '17 23:05 garrettmoon