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
Share
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…

Keep reading with a 7-day free trial

Subscribe to Type Safely to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Type Safely
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture