<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/DocumentLaunchView/init(_:for:backgroundStyle:_:onDocumentOpen:overlayAccessoryView:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI18DocumentLaunchViewV_3for15backgroundStyle_02onC4Open016overlayAccessoryE0ACyxq_G10Foundation23LocalizedStringResourceV_Say22UniformTypeIdentifiers6UTTypeVGqd__xyXEq_AI3URLVcqd_0_AA0cD13GeometryProxyVctcAA05ShapeH0Rd__AA0E0Rd_0_r0_lufc::OverloadGroup"
  },
  "title" : "init(_:for:backgroundStyle:_:onDocumentOpen:overlayAccessoryView:)"
}
-->

# init(_:for:backgroundStyle:_:onDocumentOpen:overlayAccessoryView:)

Creates a view to present when launching document-related user
experiences using a localized title, custom actions, a background style,
and an overlay accessory view.

```
@export(implementation) nonisolated init<B>(_ title: LocalizedStringResource, for contentTypes: [UTType], backgroundStyle: B, @ContentBuilder _ actions: () -> Actions, @ContentBuilder onDocumentOpen: @escaping (URL) -> DocumentView, @ContentBuilder overlayAccessoryView: @escaping (DocumentLaunchGeometryProxy) -> some View) where B : ShapeStyle
```

## Parameters

`title`

A title resource to use for the view title.

`contentTypes`

Content types that the view can open.

`backgroundStyle`

An optional background style of the view.

`actions`

A content builder returning the view’s actions

`onDocumentOpen`

A closure that handles an open file.

`overlayAccessoryView`

A content builder for returning the view’s overlay
accessory view.

## Discussion> Note:
> An alternative to `DocumentLaunchView` is a scene variant
> of this API: ``doc://com.apple.SwiftUI/documentation/SwiftUI/DocumentGroupLaunchScene``.
> If the app definition contains `DocumentGroup` scenes, consider using
> a `DocumentGroupLaunchScene` instead of this 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)