Type Safely

Type Safely

Snap a Sheet To Multiple Heights Like In Apple Maps With Presentation Detents

Daily Coding Tip 113

Millie Sturgeon's avatar
Millie Sturgeon
Jun 20, 2022
∙ Paid
white printer paper on brown wooden table
Photo by Elena Joland on Unsplash

Detents allow you to specify the heights that a sheet can snap to.

The view that demonstrates this provides a Form where you can choose from the existing types. While .medium and .large are defined by Apple, fraction allows a value between 0 and 1, while height allows for any height. The maximum possible height is not inf…

User's avatar

Continue reading this post for free, courtesy of Type Safely.

Or purchase a paid subscription.
© 2026 Type Safely · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture