Skip to content

Out of bounds error #59

@VinceMikhailKearney

Description

@VinceMikhailKearney

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions