I have a basic implementation of NSCollectionViewLayout
very similar to NSCollectionViewFlowLayout
:
It places item in a horizontal row. If there's not enough room, the next item is added to the next row and so on.
My question: how can I animate a layout change when an item moves from the first row into the second row?
Here's an example:
Note how item #3 "jumps" from the first to the second row. I'd like to animate that change.
There are lots of methods to animate adding/removing items, but I was not able to figure out how to animate layout changes when no items change.
The methods you're looking to override in your layout subclass are prepare(forAnimatedBoundsChange:) and finalizeAnimatedBoundsChange().
From the documentation: