dzenbot / DZNEmptyDataSet

A drop-in UITableView/UICollectionView superclass category for showing empty datasets whenever the view has no content to display
https://www.cocoacontrols.com/controls/dznemptydataset
MIT License
12.09k stars 1.73k forks source link

EmptyDataSet not showing up in WKWebView #183

Open benrudhart opened 8 years ago

benrudhart commented 8 years ago

I tried to use the emptyDataSet in WKWebView.scrollView. This doesn't work properly. I'm setting the dataSource/ delegate and implementing my custom func customViewForEmptyDataSet(scrollView: UIScrollView!) -> UIView!

when first using this, it works (sometimes) i.e. my custom view becomes visible. but if I want to show an error screen after a request error from webView: didFailProvisionalNavigation: withError: the view won't be visible. When using the Xcode ViewDebugger it becomes visible but on device/ simulator some other views are in front of this view.

Did this bug happen to anyone else?

dzenbot commented 8 years ago

Interesting. I haven't test it out using WKWebView. It used to work fine for UIWebView tho. The view hierarchy must be different on that component. Try bringing the empty data set view to front before display. We could add an exception to WKWebView, since other components might don't want the empty data set view to be on front (specially when using header and footer views on a UITableView).

qmkCamel commented 8 years ago

I have the same question . When did it support WKWebView ?

dzenbot commented 8 years ago

WKWebView hasn't been supported yet.

newdemo commented 7 years ago

Don't support WKWevView yet?

oenama commented 6 years ago

WKWebView not supported yet? :(

woshahua commented 4 years ago

actually, you can use it in WKWebView. like this

webView.scrollview.emptyDataSetSource = self
webView.scrollview.emptyDateSetDelegate = self
webView.scrollview.reloadEmptyDataSet()

I think it doesn't work right, not because of the Wkwebview. it's the problem with scrollview. In scrollview, you need to call scrollview.reloadEmptyDataSet(), every time you change the status