Closed cojoj closed 7 years ago
Hey @cojoj , If you feel something is missing feel free to push a PR ! I'll help review.
Haha, it's not that simple as I thought it'd be...
When I started with WKNavigationDelegate
it turned out that there're some methods that need to be implemented, because they have completion, so they expect some default values as to work properly. Let's say it's similar to UITableViewDataSource
for example. In that case something has has to provide default implementation for those, and of course, I'd be the best to hide them from user and place them in our proxy objects.
For example here: https://github.com/ReactiveX/RxSwift/blob/master/RxCocoa/iOS/Proxies/RxPickerViewDataSourceProxy.swift
they have something called PickerViewDataSourceNotSet
and it's a default implementation for those required methods.
I guess in order to make delegates for WKWebView
work we need to have something similar since I on every run I get the following crash:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Completion handler passed to -[NSObject webView:decidePolicyForNavigationAction:decisionHandler:] was not called'
It's really strange that WKNavigationDelegate
crashes, but WKUIDelegate
works fine, even though it's methods also have completion handlers.
@mokumoku @freak4pc @rynecheow is someone working on this issue? Can I fix? it because I have it working locally already? the delegate closure is a real pain.
Can you submit a pull request @bobgodwinx ?
@rynecheow I saw you were working on it on update/rxswift4
I mean you were on the good path though. I will take it from the branch?
fixed in #15
Right now
RxWebKit
supports only properties taken directly fromWKWebView
. When I started playing around more extensively withWebKit
I started missing stuff fromWKNavigationDelegate
andWKUIDelegate
. Is there any specific reason whyRxWebKit
doesn't implement proxies for those delegates, or is it only because you didn't need them? I'd love to see official implementation for those proxy delegates 😉 If you're willing to add them I'd be happy to implement them! Just let me know 🙌