<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UISheetPresentationController",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UISheetPresentationController"
  },
  "title" : "UISheetPresentationController"
}
-->

# UISheetPresentationController

A presentation controller that manages the appearance and behavior of a sheet.

```
@MainActor class UISheetPresentationController
```

## Overview

[`UISheetPresentationController`](/documentation/UIKit/UISheetPresentationController) lets you present your view controller as a sheet. Before you present your view controller, configure the sheet presentation controller in its [`sheetPresentationController`](/documentation/UIKit/UIViewController/sheetPresentationController) property with the behavior and appearance you want for your sheet.

```swift
// In a subclass of UIViewController, customize and present the sheet.
func showMyViewControllerInACustomizedSheet() {
    let viewControllerToPresent = MyViewController()
    if let sheet = viewControllerToPresent.sheetPresentationController {
        sheet.detents = [.medium(), .large()]
        sheet.largestUndimmedDetentIdentifier = .medium
        sheet.prefersScrollingExpandsWhenScrolledToEdge = false
        sheet.prefersEdgeAttachedInCompactHeight = true
        sheet.widthFollowsPreferredContentSizeWhenEdgeAttached = true
    }
    present(viewControllerToPresent, animated: true, completion: nil)
}
```

Sheet presentation controllers specify a sheet’s size based on a *detent*, a height where a sheet naturally rests. Detents allow a sheet to resize from one edge of its fully expanded frame while the other three edges remain fixed. You specify the detents that a sheet supports using [`detents`](/documentation/UIKit/UISheetPresentationController/detents), and monitor its most recently selected detent using [`selectedDetentIdentifier`](/documentation/UIKit/UISheetPresentationController/selectedDetentIdentifier).

> Related Sessions from WWDC21:
> Session 10063: [Customize and Resize Sheets in UIKit](https://developer.apple.com/wwdc21/10063)
> 
> Session 10068: [What’s new in UIKit](https://developer.apple.com/videos/play/wwdc2022/10068)

## Topics

### Specifying the height

[`detents`](/documentation/UIKit/UISheetPresentationController/detents)

The array of heights where a sheet can rest.

[`selectedDetentIdentifier`](/documentation/UIKit/UISheetPresentationController/selectedDetentIdentifier)

The identifier of the most recently selected detent.

[`Detent`](/documentation/UIKit/UISheetPresentationController/Detent)

An object that represents a height where a sheet naturally rests.

### Managing the delegate

[`delegate`](/documentation/UIKit/UISheetPresentationController/delegate)

The delegate of the sheet presentation controller.

[`UISheetPresentationControllerDelegate`](/documentation/UIKit/UISheetPresentationControllerDelegate)

The interface that an object implements to respond to size changes in a sheet presentation controller.

### Managing user interaction

[`largestUndimmedDetentIdentifier`](/documentation/UIKit/UISheetPresentationController/largestUndimmedDetentIdentifier)

The largest detent that doesn’t dim the view underneath the sheet.

[`prefersScrollingExpandsWhenScrolledToEdge`](/documentation/UIKit/UISheetPresentationController/prefersScrollingExpandsWhenScrolledToEdge)

A Boolean value that determines whether scrolling expands the sheet to a larger detent.

### Managing the appearance

[`prefersGrabberVisible`](/documentation/UIKit/UISheetPresentationController/prefersGrabberVisible)

A Boolean value that determines whether the sheet shows a grabber at the top.

[`prefersPageSizing`](/documentation/UIKit/UISheetPresentationController/prefersPageSizing)

A Boolean value that indicates whether the sheet sizes itself for readable content.

[`prefersEdgeAttachedInCompactHeight`](/documentation/UIKit/UISheetPresentationController/prefersEdgeAttachedInCompactHeight)

A Boolean value that determines whether the sheet attaches to the bottom edge of the screen in a compact-height size class.

[`widthFollowsPreferredContentSizeWhenEdgeAttached`](/documentation/UIKit/UISheetPresentationController/widthFollowsPreferredContentSizeWhenEdgeAttached)

A Boolean value that determines whether the sheet’s width matches its view controller’s preferred content size.

[`preferredCornerRadius`](/documentation/UIKit/UISheetPresentationController/preferredCornerRadius-3mb5)

The corner radius that the sheet attempts to present with.

[`preferredCornerRadius`](/documentation/UIKit/UISheetPresentationController/preferredCornerRadius-358tc)

The corner radius that the sheet attempts to present with.

[`UISheetPresentationControllerAutomaticDimension`](/documentation/UIKit/UISheetPresentationControllerAutomaticDimension)

The default value to apply to a dimension.

### Customizing the position

[`sourceView`](/documentation/UIKit/UISheetPresentationController/sourceView)

The view that the sheet centers itself over.

### Working with custom detents

[`-  invalidateDetents`](/documentation/UIKit/UISheetPresentationController/invalidateDetents())

Notifies the sheet to re-evaluate its detent value in the next layout pass.

### Animating changes to the sheet

[`-  animateChanges:`](/documentation/UIKit/UISheetPresentationController/animateChanges(_:))

Animates the UI changes to the sheet’s properties.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Hashable`](/documentation/Swift/Hashable)

[`UIAppearanceContainer`](/documentation/UIKit/UIAppearanceContainer)

[`Equatable`](/documentation/Swift/Equatable)

[`Sendable`](/documentation/Swift/Sendable)

[`UIContentContainer`](/documentation/UIKit/UIContentContainer)

[`CVarArg`](/documentation/Swift/CVarArg)

[`UITraitChangeObservable-67e94`](/documentation/UIKit/UITraitChangeObservable-67e94)

[`UITraitEnvironment`](/documentation/UIKit/UITraitEnvironment)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`UIFocusEnvironment`](/documentation/UIKit/UIFocusEnvironment)

### Inherits From

[`UIPresentationController`](/documentation/UIKit/UIPresentationController)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)