#WKWebView

2025-06-13

OMG, I just saw that the new #SwiftUI WebView is available already on iOS 18.4 with Xcode 26 on macOS Sequoia. 👀 Gonna try this… Finally a "swifty" way to use #WKWebView in SwiftUI.

#Apple #WWDC25

Steven G. Harrisstevengharris
2025-02-24

TIL that while it's great to be able to deploy from Xcode to your iPhone without a wire, .isInspectable won't enable opening the Safari Web Inspector on the running app without a wire connected.

Darryl Poguedpogue
2024-06-10

Kinda disappointed there aren't really any WKWebView API improvements this year. There are lots of open tickets requesting things (like notifying on safe area inset changes) to be made part of the public API, and those sit open for years with no response.

I can't open PRs on WebKit to fix those because they have to go through Apple's internal API review, but nobody is stepping up to make that happen 😞

Steven G. Harrisstevengharris
2024-01-13

In support of the theory that the symbols were just not loaded into the unicode private use area for Sonoma 14.2.1, the problem also shows up in Messages if you paste the symbol and send. The symbol shows up properly when running Messages on Monterey 12.7.2.

Steven G. Harrisstevengharris
2024-01-13

The latest combo of MacOS Sonoma 14.2.1 / Xcode 15.2 (15C500b) / SFSymbols 5.0 (91) seems to have broken SFSymbols support in a WKWebView. The trash symbol obtained from “SFSymbols->Copy symbol” shows up in Xcode, but the symbols don't seem to be loaded into the Unicode private use area-b like they should have been. At least that's what it looks like to me. Any of you other users on Mastondon who have encountered it? Occurs on , , and

import SwiftUI
import WebKit

struct ContentView: View {
    let string =
"""
<!doctype html>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<html>
    <head>
        <style>
            body {
                font-family: "-apple-system"
            }
        </style>
    </head>
    <body>
        <p>Hello trash symbol: 􀈑</p>
    </body>
</html>
"""
    var body: some View {
        WebView(html: string)
            .padding()
    }
}

struct WebView: UIViewRepresentable {
    let html: String?
    
    init(html: String? = nil) {
        self.html = html
    }
    
    func makeUIView(context: Context) -> WKWebView  {
        let wkWebView = WKWebView()
        if let html {
            wkWebView.loadHTMLString(html, baseURL: nil)
        }
        return wkWebView
    }
    
    func updateUIView(_ uiView: WKWebView, context: Context) {}
}The string “Hello trash symbol:” followed by an empty square, indicating a missing symbol.
Steven G. Harrisstevengharris
2023-08-15

I was able to install Sonoma Beta 5 along with the 15 Beta 6 on my Intel iMac directly from the Settings->General->Software Update. Lo and behold, this issue (github.com/stevengharris/Marku) is fixed!!! I was afraid that it would never receive attention given how lonely I was feeling at the intersection point of the Venn diagram of Intel processor + + + the need to intercept keydown.

Steven G. Harrisstevengharris
2023-08-10

Apple says a fix for keydown not being triggered in for Mac Catalyst (not iOS, not MacOS) running on Intel (not M1/M2) as of MacOS 13 is available in MacOS 14 Beta 5. Yay! Now I get to figure out how to set up Beta 5 to see if it really is fixed. Reproducible case here: github.com/stevengharris/Keydo. Issue for MarkupEditor here: github.com/stevengharris/Marku

Steven G. Harrisstevengharris
2023-06-14

If you build with an older SDK (i.e., on Ventura), the isInspectable property doesn't exist. You can block out code at compile time by checking on the compiler version. This also solved some GitHub actions build issues for me.

compiler(>=5.8)
if (iOS 16.4, *) {
webView.isInspectable = MarkupEditor.isInspectable
}

Thanks to @mattiem for pointing to this blog post - chimehq.com/blog/swift-and-old - which was very helpful.

Thibault Le Cornectibimac
2023-05-01

To all who follow me :

I’m trying to snapshot a (used to display a YT player with by @SvenTiigi).
It works well on simulator but it never works on real device (where I always get black image)!
I wonder if one of you have ever tried something equivalent, if you had problem too and if you have a solution ?

Nicolas Holzschuchnholzschuch@piaille.fr
2023-02-22

The same notebook renders well in Carnets for iOS, doesn't render on iPads. Is there a known issue with #WkWebView and #SVG graphics?

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst