I have an issue with UICollectionView cells which I allow to rotate.

I have a UICollectionView which I use as a type of media viewer with Images/Video/Audio which is full screen and paged. This allows the user to swipe between the pieces of media much like the Apple photos app.

When rotating the UICollectionView the CV loses its offset and thus I call scroll to offset in the willTransition: method.

-(void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator [coordinator animateAlongsideTransition:nil completion:^(id<UIViewControllerTransitionCoordinatorContext> context) { [self.collectionView setContentOffset:CGPointMake((width * currentPage), 0.0)]; [UIView animateWithDuration:.2 animations:^{ self.collectionView.alpha = 1; } completion:^(BOOL finished) { UICollectionViewCell *cell = [self cellInView]; if([cell isKindOfClass:[MediaImageCell class]]){ } else if([cell isKindOfClass:[MediaVideoCell class]]){ [((MediaVideoCell *)cell) cellFinishedRotating]; } else if([cell isKindOfClass:[MediaAudioCell class]]){ } }]; }];

This causes the cells the have cellForRow: called meaning many of my cells are being reconfigured and also makes the rotation look ugly.

I have seen apps that use a similar feature in which they have paged media which when rotated looks perfect, Twitter (recent update), Box, DropBox.

At the moment my CollectionView is using a subclassed Flow Layout but I am doing nothing special in this only setting the sectionInset and ScrollDirection.

Here is a link to a short video I made attempting to detail the issue without doing anything in the rotation method.

Video