I have a UICollectionView with a segmented control to switch between data. But how do I change the UICollectionViewCell size propertie
if you use Gaurav Rami's code bellow
let cellSize = CGSize(width:80 , height:80)
let layout = UICollectionViewFlowLayout()
layout.scrollDirection = .vertical //.horizontal
layout.itemSize = cellSize
layout.sectionInset = UIEdgeInsets(top: 1, left: 1, bottom: 1, right: 1)
layout.minimumLineSpacing = 1.0
layout.minimumInteritemSpacing = 1.0
myCollectionView.setCollectionViewLayout(layout, animated: true)
and get this message "Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has been rendered at least once before snapshotting or snapshot after screen updates." you should remove animated when setting view layout for collection view
myCollectionView.setCollectionViewLayout(layout, animated: false)
then the message will disappear