<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/DocumentLaunchView",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI18DocumentLaunchViewV"
  },
  "title" : "DocumentLaunchView"
}
-->

# DocumentLaunchView

A view to present when launching document-related user experience.

```
nonisolated struct DocumentLaunchView<Actions, DocumentView> where Actions : View, DocumentView : View
```

## Overview> Important: To create new documents, set
> <doc://com.apple.documentation/documentation/BundleResources/Information-Property-List/UISupportsDocumentBrowser> to `YES` in your app’s
> information property list. Without this key, document creation doesn’t work.

Configure `DocumentLaunchView` to open and display files and trigger custom
actions.

For example, an application that offers writing books can present
the `DocumentLaunchView` as its launch view:

```
public import UniformTypeIdentifiers

struct BookEditorLaunchView: View {

    var body: some View {
        DocumentLaunchView(for: [.book]) {
            NewDocumentButton("Start New Book")
        } onDocumentOpen: { url in
            BookEditor(url)
        }
    }
}

struct BookEditor: View {
    init(_ url: URL) { }
}

extension UTType {
    static let book = UTType(exportedAs: "com.example.bookEditor")
}
```

> 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.

## Topics

### Creating a launch view with a background view

[`init(_:for:_:onDocumentOpen:)`](/documentation/SwiftUI/DocumentLaunchView/init(_:for:_:onDocumentOpen:))

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

[`init(_:for:_:onDocumentOpen:background:)`](/documentation/SwiftUI/DocumentLaunchView/init(_:for:_:onDocumentOpen:background:))

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

[`init(_:for:_:onDocumentOpen:background:backgroundAccessoryView:)`](/documentation/SwiftUI/DocumentLaunchView/init(_:for:_:onDocumentOpen:background:backgroundAccessoryView:))

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

[`init(_:for:_:onDocumentOpen:background:backgroundAccessoryView:overlayAccessoryView:)`](/documentation/SwiftUI/DocumentLaunchView/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.

[`init(_:for:_:onDocumentOpen:background:overlayAccessoryView:)`](/documentation/SwiftUI/DocumentLaunchView/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.

[`init(_:for:_:onDocumentOpen:backgroundAccessoryView:)`](/documentation/SwiftUI/DocumentLaunchView/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.

[`init(_:for:_:onDocumentOpen:backgroundAccessoryView:overlayAccessoryView:)`](/documentation/SwiftUI/DocumentLaunchView/init(_:for:_:onDocumentOpen:backgroundAccessoryView:overlayAccessoryView:))

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

[`init(_:for:_:onDocumentOpen:overlayAccessoryView:)`](/documentation/SwiftUI/DocumentLaunchView/init(_:for:_:onDocumentOpen:overlayAccessoryView:))

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

### Creating a launch view with a background style

[`init(_:for:backgroundStyle:_:onDocumentOpen:)`](/documentation/SwiftUI/DocumentLaunchView/init(_:for:backgroundStyle:_:onDocumentOpen:))

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

[`init(_:for:backgroundStyle:_:onDocumentOpen:backgroundAccessoryView:)`](/documentation/SwiftUI/DocumentLaunchView/init(_:for:backgroundStyle:_:onDocumentOpen:backgroundAccessoryView:))

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

[`init(_:for:backgroundStyle:_:onDocumentOpen:backgroundAccessoryView:overlayAccessoryView:)`](/documentation/SwiftUI/DocumentLaunchView/init(_:for:backgroundStyle:_:onDocumentOpen:backgroundAccessoryView:overlayAccessoryView:))

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

[`init(_:for:backgroundStyle:_:onDocumentOpen:overlayAccessoryView:)`](/documentation/SwiftUI/DocumentLaunchView/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.

### Displaying the launch view

[`var body: some View`](/documentation/SwiftUI/DocumentLaunchView/body)

The body of the view.

## Relationships

### Conforms To

[`View`](/documentation/SwiftUI/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)