Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom smaller Detents in UISheetPresentationController?

Apple has finally released an Apple Maps-style "bottom sheet" control in iOS 15 in 2021: UISheetPresentationController.

This type of sheet natively supports "detents", the heights at which a sheet naturally rests. The default large() detent represents a full-screen sheet presentation, whereas the medium() detent covers approximately half the screen.

However, there is no small() detent in the API.

Apple Maps and similar apps typically show a small fully-collapsed sheet at the bottom of the screen, which can be dragged to half-height, which can be dragged to full-screen. Apple Maps actually shows a 1/3rd height screen, which appears to be different than the medium() detent.

Apple Maps Small Collapsed Bottom Sheet

Using UISheetPresentationController, not any 3rd-party reimplementation of bottom sheets, how can a sheet be presented with an Apple Maps-style collapsed small detent at the bottom of the screen?

like image 387
pkamb Avatar asked Jun 09 '21 16:06

pkamb


1 Answers

I filed a radar to ask for support. I suggest anyone else who wants to see this does the same. Realistically medium and large won't cut it and we'll be relying on third party libs still if this doesn't get added before iOS 15 is released.

like image 65
BinaryGuy Avatar answered Oct 14 '22 09:10

BinaryGuy