Post

Replies

Boosts

Views

Activity

Reply to Is UIViewRepresentable even capable of handling autolayout within a view?
Question is old but for the benefit of others I had this problem with SwiftUI having no size for the UIViewRepresentable. I solved it by adding an intrinsicContentSize variable in the base view (not the UIViewRepresentable wrapper), that calculates the size based on the key subview frames and some padding. eg. swift override var intrinsicContentSize: CGSize { textContainer.frame.size + (mainViewPadding * 2) }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’21