<!--
{
  "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/addButton(withTitle:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIActionSheet(im)addButtonWithTitle:"
  },
  "title" : "addButton(withTitle:)"
}
-->

# addButton(withTitle:)

Adds a custom button to the action sheet.

```
func addButton(withTitle title: String?) -> Int
```

## Parameters

`title`

The title of the new button.

## Return Value

The index of the new button. Button indices start at `0` and increase in the order they are added.

## See Also

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

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



---

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)