I was getting the same warning. Unsatisfied with the “reloadData” approach, I found that calling [self.collectionView.collectionViewFlowLayout invalidateLayout]
before setting the frame of the collection view silenced the warning and yielded the expected results.