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

collapseAllRows() causes a crash when called in didSelectRowAt #20

Open
swiatrzyk opened this issue Nov 24, 2020 · 0 comments
Open

collapseAllRows() causes a crash when called in didSelectRowAt #20

swiatrzyk opened this issue Nov 24, 2020 · 0 comments

Comments

@swiatrzyk
Copy link

swiatrzyk commented Nov 24, 2020

I'm about to implement that when there is a child that is not expandable, then return selected cell + collapse whole treeView.
But when I call collapseAllRows() in didSelectRowAt, there goes a crash.
You can replicate that in demo project by adding:

    func treeView(_ treeView: CITreeView, didSelectRowAt treeViewNode: CITreeViewNode, at indexPath: IndexPath) {
        guard let cellData = treeViewNode.item as? CITreeViewData else {fatalError()}
        if cellData.children.isEmpty {
            self.sampleTreeView.collapseAllRows()
        }
    }

Pod version: 1.6.1
Then tap Sedan -> Alfa Romeo.
After that there goes "Index out or range error" in setExpandTreeViewNode of CTTreeViewController.

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

No branches or pull requests

1 participant