Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Out of bounds error #59

Open
VinceMikhailKearney opened this issue Nov 22, 2019 · 1 comment
Open

Out of bounds error #59

VinceMikhailKearney opened this issue Nov 22, 2019 · 1 comment
Labels

Comments

@VinceMikhailKearney
Copy link

Hello!

So I'm using this in a static manner to show 3 parent cells, each of which have 1 child. Therefore there should be a total of 3 cells.
However, if I check the number of items on the dataSource it reports 4.
I'm getting an out of bounds error in scrollCellIfNeeded as it thinks the last indexPath does not exist, which it doesn't, so crashes out on me. This only occurs if I try to select the bottom parent when the middle one is open and the top is slightly off the screen.

I couldn't actually see why it thought there 4 items, not 3, however, fixing this specific bug is relatively easy.

Would a PR to resolve the issue be best or can you think of why this issue would be occurring? I think it's best to ensure the indexPath to scroll to is actually in the range of the table, rather than attempting to do so without checking.

@Vkt0r Vkt0r added the bug label Nov 29, 2019
@Vkt0r
Copy link
Owner

Vkt0r commented Nov 29, 2019

@VinceMikhailKearney Thanks for report this. It sounds like a calculation is not being made correctly. A PR with a fix would be very welcome if you're interested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants