Skip to main content

Module hosting

Module hosting 

Source
Expand description

The bridge that puts a SwiftUI view inside a native view.

AppKit has NSHostingView, a view you can use directly. UIKit has no equivalent: the only bridge is UIHostingController, and the view comes out of its .view property. So on iOS this type holds both — the controller, because that is what owns rootView and answers sizeThatFits, and the view, because that is what everything else wants.

Structs§

HostingView
A hosting view whose root view can be replaced at any time.