WKWebkit and NSTextField

I have a Swift app that puts a WKWebView and NSTextfield on a window…
The problem is… when I do, the WebView doesn’t show up… If I remove the TextField then it does, and works fine. put the TF back, the the WebView vanishes.

After a few hours of testing, and debugging, I have discovered this. When both controls are on the window, the WebView frame all of a sudden has a frame size change to 0,0. So in fact the control is still there, but only a a “dot”… WIthout the TF on the screen, the frame size remains as it should be.

This happens sometime during the whole window set up… as soon as windowDidBecomeMain event takes place, the frame size is gone… but I cannot tell what (if anything is happening just prior to this event.

If I use the now deprecated WebKit instead, it works fine…

Anyone have any clue what might be going on?

use the deprecated Webkit while…Xojo?

Apple only accepts WKWebkit since macOS 10.14… this is Swift not Xojo…

Ironically the exact same app in Xojo works…but I can;t be 100% sure what under the hood there.

That’s sadly true!

Solved… I had to embed the WKWebKit control in a hosting NSView… and delegate all the events via the NSView… don’t know why, but now it seems to work just fine