-
Notifications
You must be signed in to change notification settings - Fork 699
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
Crash on data reload with 0 items and sections #76
Comments
As a follow up, I thought I'd share a full example of what I describe in my initial filing. Below is the view controller code. It is based off a storyboard with a UICollectionViewController. Layout object for the UICollectionViewController is set toCHTCollectionViewWaterfallLayout. Two different UIBarButtonItems are connected to the deleteFirstSection and deleteAllSections methods.
|
I'm experiencing this as well. |
Can anyone fix this issue? |
I'm experiencing this issue as well, but I solved this by never returns zero in the collection view data source,
and then check and returns an supplementary view with empty contents,
you may need to check for other data source methods as well for this modification. |
Interesting. Can't |
I tried to modify the |
Fixed in PR #93 |
Thanks @dginsburg ! |
Initialization of floatingSectionIndex is needed in prepareLayout. When search result filtered down sections, the current floating section doesn't exist anymore |
I'm getting this error in the Swift version. |
deinit { |
First off, great work on the layout. I use the layout for a couple sections with three or four items each. Each section has a header and the items are populated by data retrieved from a network call. I have a method that removes all objects from the data source and sets everything back to zero. For example, 0 sections, with 0 items. Essentially an empty array. The method looks a bit like this:
Whenever I reset everything back to zero, and call reloadData, the following exception is thrown:
A similar issue was reported on another custom UICollectionViewLayout here. However, the other layout appears to have some sort of cache invalidation logic built in.
It looks like the layout object is still trying to return attributes for a header that no longer exists. Any advice you have on resolving this issue is much appreciated. Thanks in advance!
The text was updated successfully, but these errors were encountered: