I am using this approach if you only want to do something at a rotation event:
- (void)updateViewConstraints {
[super updateViewConstraints];
[[_cvMyCollectionView collectionViewLayout] invalidateLayout];
}
and then override the method from UICollectionViewDelegateFlowLayout
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
/*
* Calculate size, example
* */
CGSize cellSize = CGSizeMake(150.0f, 150.0f);
return cellSize;
}
with the desired behaviour in landscape and portrait or depending on the width for example.
You can even save previous orientation and check if it changed to decide whether to invalidate layout or not.
This will refresh sizes even when you come back again in a navigation controller.