From 1784973d4de6cc9c4a1d221046f9e4cecb815eb0 Mon Sep 17 00:00:00 2001 From: Kazumasa Shimomura Date: Wed, 1 Nov 2023 11:52:45 +0900 Subject: [PATCH] fix: fix swiftui sizing --- Sources/SwiftUISupport/ComponentSwiftUISupport.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/SwiftUISupport/ComponentSwiftUISupport.swift b/Sources/SwiftUISupport/ComponentSwiftUISupport.swift index 94ec7a7..e14be10 100644 --- a/Sources/SwiftUISupport/ComponentSwiftUISupport.swift +++ b/Sources/SwiftUISupport/ComponentSwiftUISupport.swift @@ -38,6 +38,10 @@ private struct ComponentRepresenting: UIViewRepresentable { uiView.render(component: AnyComponent(component)) proxy.uiView = uiView } + + func sizeThatFits(_ proposal: ProposedViewSize, uiView: UIComponentView, context: Context) -> CGSize? { + uiView.intrinsicContentSize + } } private final class UIComponentView: UIView, ComponentRenderable {