Hello everybody!
TLDR: Issues with visibleItemsInvalidationHandler
. Minimal code to reproduce available.
I've been working with Compositional Layout for a while now and recently I've found myself needing to implement custom animation based on scroll position of UI elements. Once I found visibleItemsInvalidationHandler
it felt like the exact solution that I needed. Once I implement I've found out it doesn't quite behave as you'd expect.
To put it simply, it seems like the animations only work if your whole layout does not use .estimated
nor .uniformAcrossSiblings
. As soon as you use them then the animations will stop working, I've debugged it deeper and it seems like the invalidation context generated by it does not include the indexPath of the cells, which is always included in the version in which it works.
Feel free to swap the line 51 with its comment to flip between the working and failing version of it.
My final question therefore is... Is this the expected behavior? The documentation doesn't give any clues about such behavior and although I've tried relentlessly to find a workaround for this specific hiccup I was not successful with it.