Multiple Sized CollectionView Cell

enter image description here I want to make multiple UICollectionViewCells of Various size like the image.

Upvotes: 0

Views: 36

Answers (1)

bunty kumar
bunty kumar

Reputation: 71

Use collectionViewFlowLayout and make a function inside collectionViewFlowLayout subclass and call that function from following function to give desired size for the cell

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize

Upvotes: 1

Related Questions