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

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

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

## Declaration

```swift
nonisolated init(_ title: LocalizedStringKey, for contentTypes: [UTType], @ContentBuilder _ actions: () -> Actions, @ContentBuilder onDocumentOpen: @escaping (URL) -> DocumentView, @ContentBuilder backgroundAccessoryView: @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.
- `backgroundAccessoryView`: A content builder for returning the view’s background 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.
