DZNEmptyDataSet
DZNEmptyDataSet copied to clipboard
Empty string not visible after table scrolled up and cleared
For a UITableView inside a UIViewController, i observed an issue as below. my view shows UISearchController with scope bar.
I am returning string from description delegate method to show empty state
- Search using UISearchController and load table with data
- Clear the search bar text - empty string appears in middle
- Search using UISearchController again and load table with data
- Scroll up table 2-3 rows
- Clear the search bar text - empty string appears near bottom
Another similar scenario
- Search using UISearchController and load table with data
- Clear the search bar text - empty string appears in middle
- Search using UISearchController again and load table with data
- Scroll up table many rows
- Clear the search bar text - empty string doesn't appear
I have captured screenshot of visual debugger that shows emptyDataSetlView starting near bottom which seems to be the reason empty string is not visible. see screenshot.
I tried below from some suggestions from some issues here. In fact, offset() method isnt even called.
func verticalOffset(forEmptyDataSet scrollView: UIScrollView!) -> CGFloat {
return self.feedTableView.frame.size.height/2.0
}
func offset(forEmptyDataSet scrollView: UIScrollView!) -> CGPoint {
let top = scrollView.contentInset.top / 2
let bottom = scrollView.contentInset.bottom / 2
return CGPoint(x: 0, y: top-bottom)
}

@dzenbot Could you please look at this issue?
Thanks Ashish