adamfootdev/BottomSheet

Feature request: Set preferredContentSize

benubois opened this issue · 1 comments

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 if widthFollowsPreferredContentSizeWhenEdgeAttached = true.

I was wondering if it would be possible to automatically set preferredContentSize in this component to something like view.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize) so that the sheet only takes up the width of the contentView?

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:

large

After:

small

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.