iOS 16: Bottom Sheets

Thimo Bess
arconsis
Published in
Nov 16, 2022

Sheets were introduced in SwiftUI with iOS 13. This year, however, they get a small upgrade. Finally, with iOS 16, you can set the height of the sheet yourself.

There are several built-in settings, such as.
- Medium: Uses half of the screen height
- Large: Uses the full screen height.

But also individually configurable sizes:
- Fraction: Uses the defined fraction of the screen height.
- Custom: You can slice your own presentation logic
- Fixed Height: Fixed defined height

You can configure these settings with .presentationDetents, also combinations are possible.

Large (left), Medium(Middle), Fraction with 0.3 (right)

Using .presentationDragIndicator you can show or hide the indicator that you can see in the top center image.

Example Code

If you want to try it out by yourself, here is an example code:

If you are interested in more iOS 16 feature videos, check out the following playlist.

--

--