SwiftUI has a hidden CAHostingLayer API — host your SwiftUI views directly in a CALayer.
Currently used internally by UIKit/AppKit and WebKit. Available since iOS 18 / macOS 15.
I wrote a guide on how to access it without Apple's internal SDK 👇
https://gist.github.com/Kyle-Ye/8a7f12487a4ce2ca6ac9e087b09d4a20
Currently used internally by UIKit/AppKit and WebKit. Available since iOS 18 / macOS 15.
I wrote a guide on how to access it without Apple's internal SDK 👇
https://gist.github.com/Kyle-Ye/8a7f12487a4ce2ca6ac9e087b09d4a20










