---
title: UISheetPresentationController
framework: uikit
role: symbol
role_heading: Class
path: uikit/uisheetpresentationcontroller
---

# UISheetPresentationController

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

## Declaration

```swift
@MainActor class UISheetPresentationController
```

## Overview

Overview UISheetPresentationController lets you present your view controller as a sheet. Before you present your view controller, configure the sheet presentation controller in its sheetPresentationController property with the behavior and appearance you want for your sheet. // 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, and monitor its most recently selected detent using selectedDetentIdentifier. note: Session 10063: Customize and Resize Sheets in UIKit Session 10068: What’s new in UIKit

## Topics

### Specifying the height

- [detents](uikit/uisheetpresentationcontroller/detents.md)
- [selectedDetentIdentifier](uikit/uisheetpresentationcontroller/selecteddetentidentifier.md)
- [UISheetPresentationController.Detent](uikit/uisheetpresentationcontroller/detent.md)

### Managing the delegate

- [delegate](uikit/uisheetpresentationcontroller/delegate.md)
- [UISheetPresentationControllerDelegate](uikit/uisheetpresentationcontrollerdelegate.md)

### Managing user interaction

- [largestUndimmedDetentIdentifier](uikit/uisheetpresentationcontroller/largestundimmeddetentidentifier.md)
- [prefersScrollingExpandsWhenScrolledToEdge](uikit/uisheetpresentationcontroller/prefersscrollingexpandswhenscrolledtoedge.md)

### Managing the appearance

- [prefersGrabberVisible](uikit/uisheetpresentationcontroller/prefersgrabbervisible.md)
- [prefersPageSizing](uikit/uisheetpresentationcontroller/preferspagesizing.md)
- [prefersEdgeAttachedInCompactHeight](uikit/uisheetpresentationcontroller/prefersedgeattachedincompactheight.md)
- [widthFollowsPreferredContentSizeWhenEdgeAttached](uikit/uisheetpresentationcontroller/widthfollowspreferredcontentsizewhenedgeattached.md)
- [preferredCornerRadius](uikit/uisheetpresentationcontroller/preferredcornerradius-3mb5.md)

### Customizing the position

- [sourceView](uikit/uisheetpresentationcontroller/sourceview.md)

### Working with custom detents

- [invalidateDetents()](uikit/uisheetpresentationcontroller/invalidatedetents().md)

### Animating changes to the sheet

- [animateChanges(_:)](uikit/uisheetpresentationcontroller/animatechanges(_:).md)

## Relationships

### Inherits From

- [UIPresentationController](uikit/uipresentationcontroller.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [UIAppearanceContainer](uikit/uiappearancecontainer.md)
- [UIContentContainer](uikit/uicontentcontainer.md)
- [UIFocusEnvironment](uikit/uifocusenvironment.md)
- [UITraitChangeObservable](uikit/uitraitchangeobservable-67e94.md)
- [UITraitEnvironment](uikit/uitraitenvironment.md)

## See Also

### Presentation management

- [Disabling the pull-down gesture for a sheet](uikit/disabling-the-pull-down-gesture-for-a-sheet.md)
- [UIPresentationController](uikit/uipresentationcontroller.md)
