<!--
{
  "availability" : [
    "iOS: 2.0.0 - 9.0.0",
    "iPadOS: 2.0.0 - 9.0.0",
    "macCatalyst: 13.1.0 - 13.1.0"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIAlertView/init(title:message:delegate:cancelButtonTitle:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIAlertView(im)initWithTitle:message:delegate:cancelButtonTitle:otherButtonTitles:"
  },
  "title" : "init(title:message:delegate:cancelButtonTitle:)"
}
-->

# init(title:message:delegate:cancelButtonTitle:)

Convenience method for initializing an alert view.

```
convenience init(title: String?, message: String?, delegate: Any?, cancelButtonTitle: String?)
```

## Parameters

`title`

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

`message`

Descriptive text that provides more details than the title.

`delegate`

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

`cancelButtonTitle`

The title of the cancel button or `nil` if there’s no cancel button.

    Using this argument is equivalent to setting the cancel button index to the value returned by invoking [`addButton(withTitle:)`](/documentation/UIKit/UIAlertView/addButton(withTitle:))     specifying this title.

## Return Value

Newly initialized alert view.

---

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)