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

# init(_:for:_:onDocumentOpen:background:backgroundAccessoryView:overlayAccessoryView:)

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

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

## Parameters

`title`

A title resource to use for the view title.

`contentTypes`

Content types that the view can open.

`actions`

A content builder returning the view’s actions

`onDocumentOpen`

A closure that handles an open file.

`background`

A background of the view.

`backgroundAccessoryView`

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

`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)