3lvis / DATASource

Core Data's NSFetchedResultsController wrapper for UITableView and UICollectionView
Other
106 stars 27 forks source link

Handling message when tableview is empty #43

Closed guilhermekrz closed 8 years ago

guilhermekrz commented 8 years ago

I think that it would be useful to expose some delegate to enable setting custom messages when table view is empty (sorry if this is already possible, but I could not find how). Currently I am using something like this: http://stackoverflow.com/questions/28532926/if-no-table-view-results-display-no-results-on-screen

To get it working here ,while using this pod, I added a new delegate (you can check here: https://github.com/guilhermekrz/DATASource/commit/c94e89dcfe291b105fdc07d408bf1b60a40850de).

However I don't think that this is the best way to expose this. Any ideas?

3lvis commented 8 years ago

Hi @guilhermekrz!

We could have a delegate method on controllerDidChangeContent.

Something like the following could work:

optional func dataSourceDidChangeContent(dataSource: DATASource)

Feel free to add it, or I'll do it later.

guilhermekrz commented 8 years ago

Great! I will try here and then create a pull request. Thanks!