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

Empty data source does not show when I call deleteRows #31

Open
Sweeper777 opened this issue Jun 1, 2019 · 2 comments
Open

Empty data source does not show when I call deleteRows #31

Sweeper777 opened this issue Jun 1, 2019 · 2 comments

Comments

@Sweeper777
Copy link

Sweeper777 commented Jun 1, 2019

I added an empty data source like this:

    collectionView.emptyDataSetView { (view) in
        view.titleLabelString(NSAttributedString(string: "Nothing to see here!"))
        view.shouldDisplay(true)
    }

And I used deleteItems to delete the items one by one. After deleting the last item, I expected the empty data source to show up, but it does not. Bug?

@Xiaoye220
Copy link
Owner

It's look like a bug. When deleteItems, reload will not be executed. It can be solved by swizzling method deleteItems to caculate number of items and then loading emptyDataSet. But DZNEmptyDataSet didn't do this, I dont know why

@Sweeper777
Copy link
Author

I also noticed that the empty data source view does not disappear when I add a row/item to an empty table view/collection view. Probably the same issue as this.

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

2 participants