[CustomCollectionView Example]

Issue (#1366):
CustomColelctionView example app always returns YES from shouldInvalidateLayoutForBoundsChange: which triggers a re-layout.

Fix:
Comparing CGSize rather than CGRect is enough to  handle rotation support without always triggering a re-layout. .
This commit is contained in:
Hannah Troisi
2016-03-19 18:00:24 -07:00
parent 0745eabec9
commit 2dae2d1c09

View File

@@ -119,7 +119,7 @@
- (BOOL)shouldInvalidateLayoutForBoundsChange:(CGRect)newBounds - (BOOL)shouldInvalidateLayoutForBoundsChange:(CGRect)newBounds
{ {
if (!CGRectEqualToRect(self.collectionView.bounds, newBounds)) { if (!CGSizeEqualToSize(self.collectionView.bounds.size, newBounds.size)) {
return YES; return YES;
} }
return NO; return NO;