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

Missing section identifier in UICollectionViewDelegate methods when deleting sections #33

Open
absoftware opened this issue Dec 7, 2020 · 1 comment

Comments

@absoftware
Copy link

absoftware commented Dec 7, 2020

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.

@absoftware
Copy link
Author

absoftware commented Dec 7, 2020

I reported PR for this: #34

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