-
Notifications
You must be signed in to change notification settings - Fork 583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #440 Webview loading without delegate (option 2) #443
Fix #440 Webview loading without delegate (option 2) #443
Conversation
let webView = WKWebView() | ||
webView.navigationDelegate = manipulatingWKWebViewNavigationDelegate | ||
|
||
webView.load(URLRequest(url: URL(string: "https://www.pointfree.co")!)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This loads an actual URL. Is that something you want to prevent in the unit tests? I can image you want to avoid it, but it's the best real life example..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great solution!
Thanks @stephencelis ! |
…tfreeco#443) * Fix pointfreeco#440 - Improve WKWebView navigation delegate * Fix pointfreeco#440 - Replace WKWebView navigation delegate by observing wkWebView.isLoading Co-authored-by: Tieme van Veen <Tieme.vanVeen@triodos.com> Co-authored-by: Stephen Celis <stephen@stephencelis.com>
@stephencelis any idea when you're going to branch off the next release? |
@stephencelis? It would be great if we could use this in production |
\0/ thanks for merging 👯 😃 |
…tfreeco#443) * Fix pointfreeco#440 - Improve WKWebView navigation delegate * Fix pointfreeco#440 - Replace WKWebView navigation delegate by observing wkWebView.isLoading Co-authored-by: Tieme van Veen <Tieme.vanVeen@triodos.com> Co-authored-by: Stephen Celis <stephen@stephencelis.com>
…tfreeco#443) * Fix pointfreeco#440 - Improve WKWebView navigation delegate * Fix pointfreeco#440 - Replace WKWebView navigation delegate by observing wkWebView.isLoading Co-authored-by: Tieme van Veen <Tieme.vanVeen@triodos.com> Co-authored-by: Stephen Celis <stephen@stephencelis.com>
While testing #442 another time I suddenly thought it might also be possible to remove the delegate altogether and just observe the
isLoading
property on the WKWebView.I've implemented that in this PR. Happy to hear your thoughts. See comments below.