Ramotion/expanding-collection

add round to the calculation of the currentIndex in ExpandingViewController

Closed this issue · 3 comments

Thx for this cool library. I'm trying to add to my project.

Right now I have an issue with the currentIndex. When I peek at the card, the collectionView.contentOffset.x is 221.5, but when I go to the ExpandingTableViewController and then return, the collectionView.contentOffset.x changes to 221.0. This leads to currentIndex pointing at the previous card.

I guess it could be easily fixed by rounding the result.

0ber commented

I can't repeat issues in demo example. What device are you using ?

I'm testing it on an iPhone 6s. Your demo runs fine.
I guess I have some minor misalignment in my UI.

Nonetheless I thing that rounding the currentIndex value would be more appropriate than truncating the value.

Thanks! Version 0.0.6 works fine now.