Skip to content

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

Open
@kunalword

Description

@kunalword

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions