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

Crashed when expanded cell last cell at scrollCellIfNeeded() method in DataSourceProvider.swift #67

Open
kunalword opened this issue Nov 15, 2021 · 0 comments

Comments

@kunalword
Copy link

When expanding cells one after one from first to the last cell. At the last cell Crashed.
if we have three cells when trying to expand at 3 cell that indexPath { 0 : 0, 1: 4}

private func scrollCellIfNeeded(atIndexPath indexPath: IndexPath, _ tableView: UITableView) {

    let cellRect = tableView.rectForRow(at: indexPath)
    
    // Scroll to the cell in case of not being visible
    if !tableView.bounds.contains(cellRect) {
        tableView.scrollToRow(at: indexPath, at: .bottom, animated: true) // Crashed here
    }
} 

private func update(_ tableView: UITableView, _ item: DataSource.Item?, _ currentPosition: Int, _ indexPath: IndexPath, _ parentIndex: Int) {

}

due to instance numberOfChildren is an increased value by one

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