---
title: "init(_:for:_:onDocumentOpen:background:overlayAccessoryView:)"
framework: swiftui
role: symbol
role_heading: Initializer
path: "swiftui/documentlaunchview/init(_:for:_:ondocumentopen:background:overlayaccessoryview:)"
---

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

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

## Declaration

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

## Parameters

- `title`: A title key 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.
- `overlayAccessoryView`: A content builder for returning the view’s overlay accessory view.

## Discussion

Discussion note: An alternative to DocumentLaunchView is a scene variant of this API: DocumentGroupLaunchScene. If the app definition contains DocumentGroup scenes, consider using a DocumentGroupLaunchScene instead of this view.
