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

# UIActionSheet

A view that presents a set of alternatives for how to proceed with a task.

```
@MainActor class UIActionSheet
```

## Overview

In apps that target versions of iOS prior to iOS 8, use the [`UIActionSheet`](/documentation/UIKit/UIActionSheet) class to present the user with a set of alternatives for how to proceed with a given task. You can also use action sheets to prompt the user to confirm a potentially dangerous action. The action sheet contains an optional title and one or more buttons, each of which corresponds to an action to take.

Use the properties and methods of this class to configure the action sheet’s message, style, and buttons before presenting it. You should also assign a delegate to your action sheet. Your delegate object is responsible for performing the action associated with any buttons when they’re tapped and should conform to the [`UIActionSheetDelegate`](/documentation/UIKit/UIActionSheetDelegate) protocol. For more information about implementing the methods of the delegate, see [`UIActionSheetDelegate`](/documentation/UIKit/UIActionSheetDelegate).

You can present an action sheet from a toolbar, tab bar, button bar item, or from a view. This class takes the starting view and current platform into account when determining how to present the action sheet. For applications running on iPhone and iPod touch devices, the action sheet typically slides up from the bottom of the window that owns the view. For applications running on iPad devices, the action sheet is typically displayed in a popover that’s anchored to the starting view in an appropriate way. Taps outside of the popover automatically dismiss the action sheet, as do taps within any custom buttons. You can also dismiss it programmatically.

When presenting an action sheet on an iPad, there are times when you shouldn’t include a cancel button. If you’re presenting just the action sheet, the system displays the action sheet inside a popover without using an animation. Because taps outside the popover dismiss the action sheet without selecting an item, this results in a default way to cancel the sheet. Including a cancel button would therefore only cause confusion. However, if you have an existing popover and are displaying an action sheet on top of other content using an animation, a cancel button is still appropriate. For more information, see [iOS Human Interface Guidelines](https://developer.apple.com/ios/human-interface-guidelines/).

> Important:
> In iOS 4 and later, action sheets aren’t dismissed automatically when an application moves to the background. This behavior differs from earlier versions of the operating system, where action sheets were automatically canceled (and their cancellation handler executed) as part of the termination sequence for the application. Now, it’s up to you to decide whether to dismiss the action sheet (and execute its cancellation handler) or leave it visible for when your application moves back to the foreground. Remember that your application can still be terminated while in the background, so some type of action may be necessary in either case.

### Subclassing notes

[`UIActionSheet`](/documentation/UIKit/UIActionSheet) isn’t designed to be subclassed, nor should you add views to its hierarchy. If you need to present a sheet with more customization than provided by the [`UIActionSheet`](/documentation/UIKit/UIActionSheet) API, you can create your own and present it modally with [`present(_:animated:completion:)`](/documentation/UIKit/UIViewController/present(_:animated:completion:)).

## Topics

### Creating action sheets

[`init(title:delegate:cancelButtonTitle:destructiveButtonTitle:otherButtonTitles:_:)`](/documentation/UIKit/UIActionSheet/init(title:delegate:cancelButtonTitle:destructiveButtonTitle:otherButtonTitles:_:))

Creates an action sheet with the specified values.

[`-  initWithTitle:delegate:cancelButtonTitle:destructiveButtonTitle:otherButtonTitles:`](/documentation/UIKit/UIActionSheet/init(title:delegate:cancelButtonTitle:destructiveButtonTitle:))

Initializes the action sheet using the specified starting parameters.

### Setting properties

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

The receiver’s delegate or `nil` if it doesn’t have a delegate.

[`title`](/documentation/UIKit/UIActionSheet/title)

The string that appears in the receiver’s title bar.

[`visible`](/documentation/UIKit/UIActionSheet/isVisible)

A Boolean value that indicates whether the receiver is displayed.

[`actionSheetStyle`](/documentation/UIKit/UIActionSheet/actionSheetStyle)

The receiver’s presentation style.

### Configuring buttons

[`-  addButtonWithTitle:`](/documentation/UIKit/UIActionSheet/addButton(withTitle:))

Adds a custom button to the action sheet.

[`numberOfButtons`](/documentation/UIKit/UIActionSheet/numberOfButtons)

The number of buttons on the action sheet.

[`-  buttonTitleAtIndex:`](/documentation/UIKit/UIActionSheet/buttonTitle(at:))

Returns the title of the button at the specified index.

[`cancelButtonIndex`](/documentation/UIKit/UIActionSheet/cancelButtonIndex)

The index number of the cancel button.

[`destructiveButtonIndex`](/documentation/UIKit/UIActionSheet/destructiveButtonIndex)

The index number of the destructive button.

[`firstOtherButtonIndex`](/documentation/UIKit/UIActionSheet/firstOtherButtonIndex)

The index of the first custom button.

### Presenting the action sheet

[`-  showFromTabBar:`](/documentation/UIKit/UIActionSheet/show(from:)-9i3tw)

Displays an action sheet that originates from the specified tab bar.

[`-  showFromToolbar:`](/documentation/UIKit/UIActionSheet/show(from:)-1p4ap)

Displays an action sheet that originates from the specified toolbar.

[`-  showInView:`](/documentation/UIKit/UIActionSheet/show(in:))

Displays an action sheet that originates from the specified view.

[`-  showFromBarButtonItem:animated:`](/documentation/UIKit/UIActionSheet/show(from:animated:))

Displays an action sheet that originates from the specified bar button item.

[`-  showFromRect:inView:animated:`](/documentation/UIKit/UIActionSheet/show(from:in:animated:))

Displays an action sheet that originates from the specified view.

### Dismissing the action sheet

[`-  dismissWithClickedButtonIndex:animated:`](/documentation/UIKit/UIActionSheet/dismiss(withClickedButtonIndex:animated:))

Dismisses the action sheet immediately using an optional animation.

### Constants

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

Specifies the style of an action sheet.

## Relationships

### Conforms To

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

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

[`CLBodyIdentifiable`](/documentation/CoreLocation/CLBodyIdentifiable)

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

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

[`NSCoding`](/documentation/Foundation/NSCoding)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[`CMBodyIdentifiable`](/documentation/CoreMotion/CMBodyIdentifiable)

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

[`CALayerDelegate`](/documentation/QuartzCore/CALayerDelegate)

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

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

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

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

[`NSTouchBarProvider`](/documentation/AppKit/NSTouchBarProvider)

### Inherits From

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

---

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)