Open benubois opened 3 years ago
Thanks for the suggestion. After spending some time looking into it, SwiftUI doesn't appear to work very well with preferredContentSize and have seen others file feedback for similar issues. I'll keep looking into it to see if I can find a solution.
Hi, thanks for making this!
I was watching the WWDC sheets session and at around the 9:15 mark, Russell mentions that the sheet should respect a
preferredContentSize
ifwidthFollowsPreferredContentSizeWhenEdgeAttached = true
.I was wondering if it would be possible to automatically set
preferredContentSize
in this component to something likeview.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize)
so that the sheet only takes up the width of thecontentView
?Or alternatively provide a way to set a
preferredContentSize
?I failed to get this to work, but I was hoping you would know how to do it.
Here's the example from the session:
Before:
After: