I'm creating an app as Instagram. So, I have an UICollectionView, where I placed my images, user details and likes&comments.
So, the problem is, that I set cells size in
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize {
and set the initial size as (width: 320, height: 420(320 — image, 50 — user details on top of the image and 50 — likes&comments under an image)).
But depends on likes and comments count, my bottom view size may change, for example from 50 to 200. But in this case my UICollectionViewCell does not change its size.
How can I make that depends on comments view height my UICollectionViewCell height will change too?
I'm working over it over one week and do not know how to implement it. Can anyone please help me?