ios – UICollectionView invisible cells aren’t animated when cells are deleted

[ad_1]

I’ve an issue with UICollectionView.
I’ve n sections and ni components in a piece, after I click on on the primary factor within the part, the part expands or collapses. I’ve issues when deleting from a piece, invisible components aren’t animated and are in the long run level instantly.

This occurs in the event you increase class(insert objects to part), scroll up or down, and conceal collapse class(delete objects from part), so far as I discovered, this is because of layoutAttributesForElements.

Lifecycle in UICollectionViewLayout so far as I perceive is that this:

  1. including components – put together methodology and layoutAttributesForElements
  2. scrolling – layoutAttributesForElements is known as
  3. take away components put together and layoutAttributesForElements

The rect in layoutAttributesForElements are completely different relying on the operation. When increasing a class (inserting components right into a part), the rect in layoutAttributesForElements is the same as (0,0,320,1600) for instance.
When scrolling (0, scrollOffset, 320, 840).
When hiding a class (eradicating components from a piece), the rect in layoutAttributesForElements is (0, 0, 320, 1600)

I am utilizing RxDataSource for diff and default UIColletionViewFlowLayout.

If anybody has encountered such an issue or is aware of why that is taking place, please assist 🙂

instance

[ad_2]

Leave a Reply