I used UICollectionView (flowlayout) to build a simple layout. the width for each cell is set to the width of screen using self.view.frame.width
self.view.frame.width
but whe
I solved the issue using below method
override func viewDidLayoutSubviews() { if let flowLayout = collectionView.collectionViewLayout as? UICollectionViewFlowLayout { collectionView.collectionViewLayout.invalidateLayout() collectionView.collectionViewLayout = flowLayout } }