Closed amanbolat closed 8 years ago
Overwriting any UITableViewDataSource
breaks the functionality of DATASource
, for your use case I would advise you to do something like:
// In your DATASource declaration
self.source = DATASource(...)
self.source.delegate = self
extension MyController: DATASourceDelegate {
func dataSourceDidChangeContent(dataSource: DATASource) {
if dataSource.isEmpty {
// show custom message
}
}
}
I hope this helps, let me know if this doesn't work and I'll reopen the issue.
@3lvis Yes, you are right. I'm already using isEmpty variable to show or not show Empty message. However i don't understand why numberOfSectionsInTableView
returns 1?
@amanbolat I guess that's on your side, please make sure to not overwrite any UITableViewDataSource
method on your controllers if you're using DATASource
, otherwise you'll have unexpected behaviour.
I want show custom message when table view is empty, but it always return 1, even if theres is no data.
But, when i use this function without implementing DATASource, just in my own table, it returns correct count of sections:
Can't find any explanation for that.