Skip to content

Commit

Permalink
fix: fix swiftui sizing
Browse files Browse the repository at this point in the history
  • Loading branch information
s2mr committed Nov 1, 2023
1 parent f123ec5 commit 1784973
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/SwiftUISupport/ComponentSwiftUISupport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ private struct ComponentRepresenting<C: Component>: 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 {
Expand Down

0 comments on commit 1784973

Please sign in to comment.