I\'m creating a full screen image gallery using a UICollectionView. When the user rotates the device, I perform updates to the UICollectionView wit
UICollectionView
I replaced
func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator)
by
func willTransition(to newCollection: UITraitCollection, with coordinator: UIViewControllerTransitionCoordinator)
and it works for me.