I'm using Async in my IOS app and need a fluid scroll for the CollectionView so i'm trying to use ASyncDisplayKit that seems to be made to have smooth scroll.
All the samples are made in ObjectiveC, i would like to translate this part of code:
- (ASCellNodeBlock)tableView:(ASTableView *)tableView nodeBlockForRowAtIndexPath:(NSIndexPath *)indexPath
{
PhotoModel *photoModel = [_photoFeed objectAtIndex:indexPath.row];
// this will be executed on a background thread - important to make sure it's thread safe
ASCellNode *(^ASCellNodeBlock)() = ^ASCellNode *() {
PhotoCellNode *cellNode = [[PhotoCellNode alloc] initWithPhotoObject:photoModel];
return cellNode;
};
return ASCellNodeBlock;
}
Can anyone help me in translating this code in Swift?