---
title: destructiveButtonIndex
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uiactionsheet/destructivebuttonindex
---

# destructiveButtonIndex

The index number of the destructive button.

## Declaration

```swift
var destructiveButtonIndex: Int { get set }
```

## Discussion

Discussion Button indices start at 0. The default value of this property is normally -1, which indicates that no destructive button has been set. However, a destructive button may be created and set automatically by the init(title:delegate:cancelButtonTitle:destructiveButtonTitle:) method. If you use that method to create a destructive button, you should not change the value of this property.

## See Also

### Configuring buttons

- [addButton(withTitle:)](uikit/uiactionsheet/addbutton(withtitle:).md)
- [numberOfButtons](uikit/uiactionsheet/numberofbuttons.md)
- [buttonTitle(at:)](uikit/uiactionsheet/buttontitle(at:).md)
- [cancelButtonIndex](uikit/uiactionsheet/cancelbuttonindex.md)
- [firstOtherButtonIndex](uikit/uiactionsheet/firstotherbuttonindex.md)
