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

# init(_:isPresented:presenting:actions:)

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

```
@export(implementation) nonisolated init<T>(_ titleResource: LocalizedStringResource, isPresented: Binding<Bool>, presenting data: T?, @ContentBuilder actions: (T) -> Actions) where Message == EmptyView
```

## Parameters

`titleResource`

The title of the alert.

`isPresented`

A binding to a Boolean value that determines whether to
present the alert. When someone presses or taps one of the alert’s
actions, the system sets this value to `false` and dismisses.

`data`

A source of truth that is passed to the alert to
populate the message and actions.

`actions`

A [`ContentBuilder`](/documentation/SwiftUI/ContentBuilder) returning the actions 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)