<!--
{
  "availability" : [
    "macOS: 15.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/AlertScene/init(_:item:actions:message:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI10AlertSceneV_4item7actions7messageACyxq_Gqd___AA7BindingVyqd_0_SgGxqd_0_XEq_qd_0_XEtcSyRd__r0_lufc::OverloadGroup"
  },
  "title" : "init(_:item:actions:message:)"
}
-->

# init(_:item:actions:message:)

Creates an alert scene, using the given data to produce the alert’s
content with a title, a set of actions, and a message.
Note that this creates a text view on your behalf.

```
@export(implementation) nonisolated init<S, T>(_ title: S, item data: Binding<T?>, @ContentBuilder actions: (T) -> Actions, @ContentBuilder message: (T) -> Message) where S : StringProtocol
```

## Parameters

`title`

A text string used as the title of the alert.

`data`

A binding to optional source of truth for the alert. The
system presents the alert when the binding’s value is non-nil. When
someone presses or taps one of the alert’s actions, the system sets
this value to `nil` and dismisses. The system passes the contents
to the alert to populate the message and actions.

`actions`

A [`ContentBuilder`](/documentation/SwiftUI/ContentBuilder) returning the actions for the dialog.

`message`

A [`ContentBuilder`](/documentation/SwiftUI/ContentBuilder) returning the message for the dialog.

---

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)