From 2dae2d1c09933dc536ecdb9571c0d8d67c4bf6d3 Mon Sep 17 00:00:00 2001 From: Hannah Troisi Date: Sat, 19 Mar 2016 18:00:24 -0700 Subject: [PATCH] [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. . --- .../CustomCollectionView/Sample/MosaicCollectionViewLayout.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/CustomCollectionView/Sample/MosaicCollectionViewLayout.m b/examples/CustomCollectionView/Sample/MosaicCollectionViewLayout.m index 0e2c65d027..67654b0df9 100644 --- a/examples/CustomCollectionView/Sample/MosaicCollectionViewLayout.m +++ b/examples/CustomCollectionView/Sample/MosaicCollectionViewLayout.m @@ -119,7 +119,7 @@ - (BOOL)shouldInvalidateLayoutForBoundsChange:(CGRect)newBounds { - if (!CGRectEqualToRect(self.collectionView.bounds, newBounds)) { + if (!CGSizeEqualToSize(self.collectionView.bounds.size, newBounds.size)) { return YES; } return NO;