Skip to content

Added UIScrollViewDelegate modifier to WebView #48

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rbenjamin
Copy link

I added a modifier to WebView to support UIScrollViewDelegate. I'm implementing WebUI with a custom toolbar and wanted to ensure the toolbar view hides when the user scrolls down and appears when they scroll up. This is my first contribution to someone else's project -- hope I got it right!

Allows the SwiftUI container / caller to set the WKWebView.scrollView.delegate with the modifier scrollViewDelegate(_:).

Allows the SwiftUI container / caller to set the WKWebView.scrollView.delegate with the modifier scrollViewDelegate(_:).
@rbenjamin rbenjamin requested a review from Kyome22 as a code owner February 12, 2025 18:42
@Kyome22
Copy link
Contributor

Kyome22 commented Feb 13, 2025

@rbenjamin Thank you for creating the pull request. Please make the following changes:

  • Add a simple implementation to the demo app as much as possible.
  • If possible, add UI tests for the demo app.
  • Add unit tests for the newly added API.
  • Standardize the label scrollDelegate to scrollViewDelegate.

After adding the tests, please verify that the existing implementation (allowsScrollViewBounces and refreshable()) is not negatively impacted.

… WKWebView.stopLoading(). Added Tests to WebViewProxyTests corresponding to stopLoading implementation, along with corresponding function in Mock.
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