0Pricing
SwiftUI Academy · Lesson

Detents & Drag Indicators

Resize sheets with presentation detents.

What Are Detents?

A detent is a stopping height a sheet can rest at, like half-open or full. They let users resize the sheet by dragging it. 📏

The presentationDetents Modifier

Add presentationDetents inside the sheet content to list the heights it can snap to. Pass a set of detents to enable resizing.

.presentationDetents([.medium, .large])

All lessons in this course

  1. Presenting a Sheet
  2. Detents & Drag Indicators
  3. Alerts with Actions
  4. Confirmation Dialogs
← Back to SwiftUI Academy