Here's my problem. I have a UICollectionViewCell having an image View. The image is downloaded from a link. The images are of different sizes and I want the collectionView cell size to change with the image size. I am currently accomplishing this by forcing the layout inside
func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath)
by placing this line of code in it
collectionViewTrending.reloadItemsAtIndexPaths([indexPath])
The below UICollectionViewDelegate
function
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath)
is handling the resizing of the cell. Though this is working but it definitely is NOT efficient. It is inefficient because scrolling on the collectionView is taking longer and it is not smooth. Is there any way in which I can resize the cell without degrading the performance?