I am using UICollectionViewFlowLayout. My cells contain UILabels that differ in height (number of rows).
It seems that the best way to get cell height would be in a subclass of UICollectionViewCell , because that's where I set the layout and gain access to the internal size of my views, BUT:
collectionView: layout: sizeForItemAtIndexPath: is called before the collectionView: cellForItemAtIndexPath: delegate method, which means I need to know the cell height before I have the actual cell layout.
Everything that I have come up with so far seems too complicated, for example, starting from the height of a fixed cell, referring to the actual height after the marks in the load on the cell and again loading the data with the correct height. Is there a better way to do this?
ios objective-c uicollectionview uicollectionviewcell
Alexander Borisenko
source share