I'm creating a grid view using a collection view but some big iPhones have spacing on the right side.
I used the code below in collectionViewLayout method:
return CGSizeMake(cellSize / 4, cellSize /4)
Please see the image for more details.
The problem is solved after added below method:
- (void)viewDidLayoutSubviews {
[super viewDidLayoutSubviews];
//Invalidate collection view layout to make it recalculate
[yourCollectionView.collectionViewLayout invalidateLayout];
}