Skip to content

Missing section identifier in UICollectionViewDelegate methods when deleting sections #33

Open
@absoftware

Description

@absoftware

Checklist

  • [YES] Reviewed the README and documents.
  • [YES] Searched existing issues for ensure not duplicated.

Description

When it's called just after applying deleted section

    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {

        // it crashes when it's called just after applying deleted section
        let sectionIdentifier1 = self.dataSource.snapshot().sectionIdentifiers[section]

        // it would be nice to have sth like this as data source is still correct when snapshot actually isn't
        let sectionIdentifier2 = self.dataSource.sectionIdentifier(for: section) 

        // I need to know which section is here
    }

then it crashes or it's not possible to get section identifier in UICollectionViewDelegate methods.

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