Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sheet sizing with navigation and table controllers #22

Closed
mpospese opened this issue Apr 24, 2023 · 0 comments · Fixed by #27
Closed

Fix sheet sizing with navigation and table controllers #22

mpospese opened this issue Apr 24, 2023 · 0 comments · Fixed by #27
Assignees
Labels
enhancement New feature or request

Comments

@mpospese
Copy link
Contributor

mpospese commented Apr 24, 2023

Intro

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

  1. Clean up sheet sizing: move properties to layout. We should be able to specify minimum, ideal, and maximum size of the sheet.
  2. Provide a mechanism whereby navigation controllers report the correct ideal size
  3. Provide a mechanism whereby table view controllers report the correct ideal size
  4. Fix bug where table view sheets do not clip their corners
@mpospese mpospese added the enhancement New feature or request label Apr 24, 2023
@mpospese mpospese self-assigned this Apr 27, 2023
@mpospese mpospese changed the title Create BottomSheetControllerDelegate with method to set intrinsic content height Fix sheet sizing with navigation and table controllers May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
1 participant