mkko / DrawerView

A drop-in view, to be used as a drawer anywhere in your app
MIT License
374 stars 57 forks source link

WKWebview Support #9

Closed jakemor closed 4 years ago

jakemor commented 5 years ago

Would be nice for DrawerView (which is amazing btw) to support swipe to dismiss for WKWebViews. Would also be nice if WKWebView was a subclass of UIScrollView!

mkko commented 5 years ago

Good idea! I wonder if it goes as simple as using the scroll view associated with the web view (i.e. WKWebView.scrollView property). Do you have any experience with WKWebView?

Also for the swipe to dismiss functionality I would love to have better approach as currently closed state doesn't really dismiss anything, just puts it offscreen.

Also, thank you for your feedback. Glad to hear you like the drawer!

mkko commented 4 years ago

I had a bit digging into this and it seems that the WKWebView is supported automatically. At least with the one page I tried, web view included an instance of WKScrollView which seems to be a subclass of UIScrollView.

Is there any particular case that doesn't work?

EDIT: I included this into the example, feel free to try the web view there.

mkko commented 4 years ago

Currently there's an example using WKWebView. If there's any further issues, please let me know.