Skip to content

Commit

Permalink
ASCollectionLayout to return a zero content size if its state is unav…
Browse files Browse the repository at this point in the history
…ailable (TextureGroup#509)
  • Loading branch information
nguyenhuy authored and bernieperez committed Apr 25, 2018
1 parent 504c954 commit ea04e69
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- Negate iOS 11 automatic estimated table row heights. [Christian Selig](https://github.com/christianselig) [#485](https://github.com/TextureGroup/Texture/pull/485)
- [Breaking] Add content offset bridging property to ASTableNode and ASCollectionNode. Deprecate related methods in ASTableView and ASCollectionView [Huy Nguyen](https://github.com/nguyenhuy) [#460](https://github.com/TextureGroup/Texture/pull/460)
- Remove re-entrant access to self.view when applying initial pending state. [Adlai Holler](https://github.com/Adlai-Holler) [#510](https://github.com/TextureGroup/Texture/pull/510)

- Small improvements in ASCollectionLayout [Huy Nguyen](https://github.com/nguyenhuy) [#509](https://github.com/TextureGroup/Texture/pull/509)

##2.4
- Fix an issue where inserting/deleting sections could lead to inconsistent supplementary element behavior. [Adlai Holler](https://github.com/Adlai-Holler)
Expand Down
5 changes: 3 additions & 2 deletions Source/Private/ASCollectionLayout.mm
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,9 @@ - (void)invalidateLayout
- (CGSize)collectionViewContentSize
{
ASDisplayNodeAssertMainThread();
ASDisplayNodeAssertNotNil(_layout, @"Collection layout state should not be nil at this point");
return _layout.contentSize;
// The content size can be queried right after a layout invalidation (https://github.com/TextureGroup/Texture/pull/509).
// In that case, return zero.
return _layout ? _layout.contentSize : CGSizeZero;
}

- (NSArray<UICollectionViewLayoutAttributes *> *)layoutAttributesForElementsInRect:(CGRect)blockingRect
Expand Down

0 comments on commit ea04e69

Please sign in to comment.