You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TheUIViewController override of initializing a bottom sheet is much more problematic than the UIView override when it comes to the sheet being able to determine the correct intrinsic content size. Ideally size should be driven by the content: larger content leads to a larger bottom sheet (up to the max, naturally).
This works well when passing in a UIView to display because views generally know their own intrinsicContentSize (which can be easily overridden in the UIView subclass).
It also works ok when passing UIViewController subclasses. If the view is properly configured, it tends to return its correct content size (the exception being if it has a UIScrollView subview).
However, system view controller subclasses such as UINavigationController and UITableViewController (the latter because it is a scroll view) don't return the correct intrinsic content size (and their views cannot be easily overridden to return the correct content size) which leads to bottom sheets that are not the correct size.
Because we can't easily modify these system classes to return the desired intrinsicSize, we should provide another mechanism so that these view controllers can report their size.
Task
Clean up sheet sizing: move properties to layout. We should be able to specify minimum, ideal, and maximum size of the sheet.
Provide a mechanism whereby navigation controllers report the correct ideal size
Provide a mechanism whereby table view controllers report the correct ideal size
Fix bug where table view sheets do not clip their corners
The text was updated successfully, but these errors were encountered:
mpospese
changed the title
Create BottomSheetControllerDelegate with method to set intrinsic content height
Fix sheet sizing with navigation and table controllers
May 3, 2023
Intro
The
UIViewController
override of initializing a bottom sheet is much more problematic than theUIView
override when it comes to the sheet being able to determine the correct intrinsic content size. Ideally size should be driven by the content: larger content leads to a larger bottom sheet (up to the max, naturally).This works well when passing in a
UIView
to display because views generally know their ownintrinsicContentSize
(which can be easily overridden in the UIView subclass).It also works ok when passing
UIViewController
subclasses. If the view is properly configured, it tends to return its correct content size (the exception being if it has aUIScrollView
subview).However, system view controller subclasses such as
UINavigationController
andUITableViewController
(the latter because it is a scroll view) don't return the correct intrinsic content size (and their views cannot be easily overridden to return the correct content size) which leads to bottom sheets that are not the correct size.Because we can't easily modify these system classes to return the desired intrinsicSize, we should provide another mechanism so that these view controllers can report their size.
Task
The text was updated successfully, but these errors were encountered: