Open
Description
From @marcelofabri on December 18, 2015 19:37
Hi,
This is my first time playing with AsyncDisplayKit, so sorry if this is a stupid question.
I'm trying to modify the CustomCollectionView
to support calculated cell heights, as the current version asks a MosaicCollectionViewLayoutDelegate
the original cell size and I'd like to avoid it.
I was able to change _itemSizeAtIndexPath
in MosaicCollectionViewLayout
to this:
- (CGSize)_itemSizeAtIndexPath:(NSIndexPath *)indexPath
{
ASCollectionView *collectionView = self.collectionView;
CGSize calculatedSize = [collectionView calculatedSizeForNodeAtIndexPath:indexPath];
CGSize size = CGSizeMake([self _columnWidthForSection:indexPath.section], calculatedSize.height);
return size;
}
However, this causes a crash unless I change the ASCollectionView
to have asyncDataFetching
set to NO
.
Is this the "right way"? How would you do this?
Thanks!
Copied from original issue: facebookarchive/AsyncDisplayKit#954