Merge pull request #1344 from eanagel/fix-collection-hang

[ASCollectionView] Ensure that we use the correct default size for collection nodes even if layoutSubviews has not been called yet
This commit is contained in:
appleguy
2016-03-08 18:10:05 -08:00
+5
View File
@@ -780,6 +780,11 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
if (_asyncDataSourceImplementsConstrainedSizeForNode) {
constrainedSize = [_asyncDataSource collectionView:self constrainedSizeForNodeAtIndexPath:indexPath];
} else {
if (! CGSizeEqualToSize(_maxSizeForNodesConstrainedSize, self.bounds.size)) {
_maxSizeForNodesConstrainedSize = self.bounds.size;
_ignoreMaxSizeChange = CGSizeEqualToSize(_maxSizeForNodesConstrainedSize, CGSizeZero);
}
CGSize maxSize = _maxSizeForNodesConstrainedSize;
if (ASScrollDirectionContainsHorizontalDirection([self scrollableDirections])) {
maxSize.width = FLT_MAX;