0

The cells with the blue bar are the cell I want to change the height for based on how many green cells there are.

Right now I can make the cell change size but looks really choppy I do this by using,

 func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
  
    return CGSize(width: 400, height: (50 * actionSteps[indexPath.row].SubActionSteps.count) + 100)
}

Is there any way to animate the change in height?

gcharita
  • 7,729
  • 3
  • 20
  • 37
PySharp
  • 11
  • 2

1 Answers1

0

Try this:

actionSteps[indexPath.row].SubActionSteps.append("") /// or whatever you're currently doing
collectionView.performBatchUpdates(nil, completion: nil)
aheze
  • 24,434
  • 8
  • 68
  • 125