Post

Replies

Boosts

Views

Activity

Reply to WebView makes website content unaccessible on the top/bottom edges
@DTS Engineer That's great to hear! I'll definitely be on the lookout for OS 26 betas to see if it gets fixed and I'll remove the workarounds that I've added. Do you know if the issue is WebKit related or SwiftUI related? Asking because if it's WebKit, it might be available on the WebKit bug tracker that's publicly available, and rather than needing to check on every beta, I could keep an eye on the bug ticket to see what's the progress! Either way, thanks again for looking into this! Can't wait for it go get fixed, it'll make my app looks so much better! 🤞
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’25
Reply to WebView makes website content unaccessible on the top/bottom edges
@DTS Engineer Here's a screenshot with .safeAreaPadding(.vertical, 100) applied to the WebView. As you can see, nothing changes. I've been playing with this, and I sort of got an idea. I could observe the scroll position of the WebView, and move the Dividers I showed on the original post as a workaround as needed (on the video I toggle them with a button just for show): But after having done that, what I really want (I think), is simply being able to remove the clipToBounds on the WebView. That way I could always position it inside the safe areas so the content is always accessible (and web content 'sticky' top/bottom is always reachable), but whenever the user scrolls, the content would flow below the navigation bars because it would bleed outside of the WebView since it's no longer clipped by the bounds. I've tried the scrollClipDisabled, but doesn't seem to change anything, any suggestions are much appreciated! Again, I'm using the VStack + Dividers combo because if I don't, the WebView fills the entire screen not respecting the SafeArea. If there's another way that's better that might help with the removal of the clipToBounds, I'm all ears! 🙏
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’25
Reply to WebView makes website content unaccessible on the top/bottom edges
Hello @DTS Engineer. I don't think that ScrollView works the same way. From my point of view, ScrollView correctly handles the safe area. The content on a ScrollView starts right below the safe area, where on the WebView it doesn't. Here's a quick example of what I mean. On the ScrollView, the content is always accessible. On the WebView, the top part is not. About the suggestions: safeAreaPadding(_:) doesn't seem to change anything when applied to the WebView. Modifying the CSS is not an option since I'm trying to load any webpage (building sort of a browser wrapper). Any more ideas? I do really want to have websites behave like they do on Safari (or on SFSafariViewController) where the website content starts below the safe area and moves under the bars as you scroll. But I can't figure out how to make WebView behave like those two.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’25
Reply to Xcode 16.4 iOS 18.5 simulator crashes for Apps requiring webkit
Greg de J. found a solution. Turns out this only happens if you call some of the WKWebView APIs, see: https://mastodon.social/@quicheindustries/114590816761623008 He found out that the issue came from calling WKWebView.createPDF. In my case, I was using WKWebView.createWebArchiveData, which also triggers the issue. Until it's solved by Apple, the easiest fix is to compile out this code on the simulator using the #if !targetEnvironment(simulator) directive. Changing my code to this, let's the app run on the simulator without issues: #if !targetEnvironment(simulator) webView.createWebArchiveData { _ in } #endif
May ’25