---
title: "actionSheet(_:didDismissWithButtonIndex:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uiactionsheetdelegate/actionsheet(_:diddismisswithbuttonindex:)"
---

# actionSheet(_:didDismissWithButtonIndex:)

Sent to the delegate after an action sheet is dismissed from the screen.

## Declaration

```swift
optional func actionSheet(_ actionSheet: UIActionSheet, didDismissWithButtonIndex buttonIndex: Int)
```

## Parameters

- `actionSheet`: The action sheet that was dismissed.
- `buttonIndex`: The index of the button that was clicked. The button indices start at 0. If this is the cancel button index, the action sheet is canceling. If -1, the cancel button index is not set.

## Discussion

Discussion This method is invoked after the animation ends and the view is hidden.

## See Also

### Customizing behavior

- [willPresent(_:)](uikit/uiactionsheetdelegate/willpresent(_:).md)
- [didPresent(_:)](uikit/uiactionsheetdelegate/didpresent(_:).md)
- [actionSheet(_:willDismissWithButtonIndex:)](uikit/uiactionsheetdelegate/actionsheet(_:willdismisswithbuttonindex:).md)
