EHHorizontalSelectionView icon indicating copy to clipboard operation
EHHorizontalSelectionView copied to clipboard

Line View Cell Selection

Open JoshR604 opened this issue 7 years ago • 1 comments

When using the LineViewCell and you have a cell selected at beginning of the SelectionView and then scroll to the far cell that was off-screen and select the far cell and scroll back to the first cell both will appear to be selected.

This is due to the fact that the cells are reusable and when a cell is selected, and scrolled off-screen, in the 'didSelectItemAtIndexPath' the collection view is unable to find the cell at the '_selectedIndex' since it is now offscreen and dequeued when using '[collectionView cellAtIndex..]'

A quick solution I came up with was to add a '_selectedCell' variable of type EEHorizontalViewCell in the EHHorizontalSelectionView class which will always give us access to the currently selected cell.

I can do a pull request for my code if you'd like.

PS. Thanks for sharing your selectionview :)

JoshR604 avatar Sep 04 '16 20:09 JoshR604

Ok. Pull it.:)

josshad avatar Sep 05 '16 08:09 josshad