[Examples] Migrate to the recommended -nodeBlock data source method, so node containers will be able to prepare and display all of its cells concurrently (#1596)

This commit is contained in:
Hanton
2019-07-28 13:08:28 -07:00
committed by Huy Nguyen
parent b933f661b9
commit 4a2d77dc9e
8 changed files with 50 additions and 35 deletions
@@ -62,9 +62,11 @@
return [_layoutExamples count];
}
- (ASCellNode *)tableNode:(ASTableNode *)tableNode nodeForRowAtIndexPath:(NSIndexPath *)indexPath
{
return [[OverviewCellNode alloc] initWithLayoutExampleClass:_layoutExamples[indexPath.row]];
- (ASCellNodeBlock)tableNode:(ASTableNode *)tableNode nodeBlockForRowAtIndexPath:(NSIndexPath *)indexPath {
Class layoutExample = _layoutExamples[indexPath.row];
return ^{
return [[OverviewCellNode alloc] initWithLayoutExampleClass:layoutExample];
};
}
- (void)tableNode:(ASTableNode *)tableNode didSelectRowAtIndexPath:(NSIndexPath *)indexPath