gordontucker / FittedSheets

Bottom sheets for iOS
MIT License
1.35k stars 278 forks source link

Support for dynamic intrinsic size #191

Closed marchy closed 1 year ago

marchy commented 1 year ago

Is there any way to make the intrinsic size update dynamically, rather than just upon initial view load?

The content of our sheet we have changes dynamically (through a set of sub-tabs, but also in other scenarios), so we would like the sheet to resize itself to contain the contents whenever this happens.

Tried invoking sheetViewController_.resize( to: .intrinsic ) as well as sheetViewController_.sizes = [.intrinsic], as well as sheetViewController_.view.layoutIfNeeded() but the sheet view still sizes to the initial/original size.

marchy commented 1 year ago

Nevermind, found sheetViewController_.updateIntrinsicHeight() which did it.

My bad!