Given a zIndex will determine depth when using indexPath values e.g [0,1], sections, row respectively. We run into issues when the section resets.
I don't know of a cleaner solution, but what I've been using at the moment is
var section = attributes.indexPath.section
var numItems = 0
while section >= 0 {
numItems += collectionView.numberOfItems(inSection: section)
section -= 1
attributes.zIndex = attributes.indexPath.row + numItems
Which seems to be doing the trick, my run into performance issues when using larger data sets. A more elegant solution will be to use visible cells and work out within the two cells an appropriate zIndex.
When sections are being used it breaks the logic
attributes.zIndex = attributes.indexPath.row
-> PageAttributeAnimator.swiftGiven a zIndex will determine depth when using indexPath values e.g [0,1], sections, row respectively. We run into issues when the section resets.
I don't know of a cleaner solution, but what I've been using at the moment is
Which seems to be doing the trick, my run into performance issues when using larger data sets. A more elegant solution will be to use visible cells and work out within the two cells an appropriate zIndex.
Happy for suggestions to make a PR