diff --git a/Sources/OpenSwiftUI/Integration/Hosting/AppKit/View/NSHostingView.swift b/Sources/OpenSwiftUI/Integration/Hosting/AppKit/View/NSHostingView.swift index 8589471dc..b0943cf9f 100644 --- a/Sources/OpenSwiftUI/Integration/Hosting/AppKit/View/NSHostingView.swift +++ b/Sources/OpenSwiftUI/Integration/Hosting/AppKit/View/NSHostingView.swift @@ -926,8 +926,18 @@ open class NSHostingView: NSView, XcodeViewDebugDataProvider where Cont // TODO: handle screen change } - @objc(swiftui_addRenderedSubview:positioned:relativeTo:) // FIXME: ViewUpdater -> AppKitAddSubview - private func openswiftui_addRenderedSubview(_ view: NSView, positioned place: NSWindow.OrderingMode, relativeTo otherView: NSView?) { + @_spi(ForOpenSwiftUIOnly) + #if OPENSWIFTUI_SWIFTUI_RENDERER + @objc(swiftui_addRenderedSubview:positioned:relativeTo:) + #endif + override public func openswiftui_addRenderedSubview( + _ subview: Any, + positioned place: Int, + relativeTo otherView: Any? + ) { + let view = subview as! NSView + let place = NSWindow.OrderingMode(rawValue: place)! + let otherView = otherView as! NSView isInsertingRenderedSubview = true addSubview(view, positioned: place, relativeTo: otherView) isInsertingRenderedSubview = false