I'm subclassing UICollectionViewLayout, and the layoutAttributesForItemAtIndexPath:
method is never called.
I know to override layoutAttributesForElementsInRect:
as well, but I'd rather not have to deal with the rect, as it will be a lot simpler if I just deal with the index path.
If layoutAttributesForItemAtIndexPath:
is never called, whats the point of it?
layoutAttributesForItemAtIndexPath:
is called in different scenarii, when you add new cells to the collection view, when you change the layout, when you reload specific index paths, etc.
You need to implement it, even though it won't get called in the "default" scenario.
layoutAttributesForItemAtIndexPath:
is actually called when changing layouts with the animated parameter set to true.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With