Skip to content
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

Merged

Conversation

teameh
Copy link
Contributor

@teameh teameh commented Mar 23, 2021

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.

let webView = WKWebView()
webView.navigationDelegate = manipulatingWKWebViewNavigationDelegate

webView.load(URLRequest(url: URL(string: "https://www.pointfree.co")!))
Copy link
Contributor Author

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..

@teameh teameh changed the title Fix webview loading without delegate Fix #440 Webview loading without delegate (option 2) Mar 23, 2021
Copy link
Member

@stephencelis stephencelis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great solution!

@stephencelis stephencelis merged commit 6bc120b into pointfreeco:main Aug 16, 2021
@teameh
Copy link
Contributor Author

teameh commented Aug 17, 2021

Thanks @stephencelis !

mac-gallagher pushed a commit to mac-gallagher/swift-snapshot-testing that referenced this pull request Aug 22, 2021
…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>
@teameh
Copy link
Contributor Author

teameh commented Sep 1, 2021

@stephencelis any idea when you're going to branch off the next release?

@teameh
Copy link
Contributor Author

teameh commented Oct 8, 2021

@stephencelis? It would be great if we could use this in production

@teameh
Copy link
Contributor Author

teameh commented Sep 22, 2022

\0/ thanks for merging 👯 😃

niil-qb pushed a commit to quickbit/swift-snapshot-testing that referenced this pull request Feb 23, 2023
…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>
Muhieddine-El-Kaissi pushed a commit to thumbtack/swift-snapshot-testing that referenced this pull request Aug 8, 2024
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants