You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working with a UICollectionView with sections and items. I use differ API animateItemAndSectionChanges to animate my sections / items changes according to my data source.
Question 1
I can't find anyway to change the animation order (insert items first, delete after etc.). I saw Patch and Diff object, but no API to use them (except the apply buf NestedExtendedDiff does not allow ordering animation.
Question 2
Maybe not related to this project, but I have sections header / footer views, and after cells animation with differ, the headers are not correctly layout (the view moves up and down, and stay above cell). Small scroll or layout invalidation solves the issue... Strange.
Thanks.
The text was updated successfully, but these errors were encountered:
To answer your first question, I don't think what you are trying to achieve is possible out of the box. When you call animateItemAndSectionChanges(oldData:newData:), you essentially transition between two states oldData and newData. Differ figures out at which index paths cells need to be inserted, deleted, or moved, and UIKit animates those accordingly. In terms of your data model, however, there are no intermediate states involved: your data source reports either oldValue or newValue when queried. If you want insertions to happen before deletions, then you need manually compute an intermediate state between oldValue and newValue, transition from oldValue to this intermediate state, and then from there to newValue.
Your second question sounds like a UIKit problem and nothing Differ can do something about. Have you tried using a regular UITableViewCell / UICollectionViewCell to draw the headers and footers? I haven't encountered any animation issues with those.
Hi,
Thanks for this wonderful project.
I'm working with a UICollectionView with sections and items. I use differ API
animateItemAndSectionChanges
to animate my sections / items changes according to my data source.Question 1
I can't find anyway to change the animation order (insert items first, delete after etc.). I saw Patch and Diff object, but no API to use them (except the
apply
buf NestedExtendedDiff does not allow ordering animation.Question 2
Maybe not related to this project, but I have sections header / footer views, and after cells animation with differ, the headers are not correctly layout (the view moves up and down, and stay above cell). Small scroll or layout invalidation solves the issue... Strange.
Thanks.
The text was updated successfully, but these errors were encountered: