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 4bfac18
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Sources/SwiftUISupport/ComponentSwiftUISupport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ private struct ComponentRepresenting<C: Component>: UIViewRepresentable {
uiView.render(component: AnyComponent(component))
proxy.uiView = uiView
}

@available(iOS 16.0, *)
func sizeThatFits(_ proposal: ProposedViewSize, uiView: UIComponentView, context: Context) -> CGSize? {
uiView.intrinsicContentSize
}
}

private final class UIComponentView: UIView, ComponentRenderable {
Expand Down

0 comments on commit 4bfac18

Please sign in to comment.