TechnologiesSwiftUI

DocumentGroupLaunchScene struct

iOSmacOStvOSwatchOSvisionOS✓ renders

A launch scene for document-based applications.

How it works

DocumentGroupLaunchScene is a scene that defines the launch experience a document-based app presents before any document window opens. When you build an app around a DocumentGroup, the system shows this scene as the entry point where people create a new document or pick an existing one, and DocumentGroupLaunchScene lets you brand and customize that moment instead of accepting the default. Reach for it in your App body, alongside the DocumentGroup itself, when you want the launch screen to carry your app's title, artwork, and call-to-action rather than a generic file picker.

  1. Declare it as a scene in your App body

    DocumentGroupLaunchScene conforms to Scene, so you place it inside the body of your App next to the DocumentGroup it customizes. The system routes the cold-launch presentation through this scene before handing control to a document window like the one whose contents resemble this DocumentGroupLaunchSceneDemo view.

  2. Supply a title for the launch screen

    The scene surfaces a title that names the app or document type for the person launching it. That role is what the prominent Text("My Documents") styled with .font(.title.bold()) stands in for here, giving the launch experience an identity above the action controls.

  3. Provide branding and supporting copy

    Beyond the title, the launch scene is where you present icon artwork and a short description of what the app does. The Image(systemName: "doc.text") rendered with .foregroundStyle(.tint) and the secondary Text explaining the document app illustrate the kind of branding and guidance the scene is meant to hold.

  4. Offer create and open actions

    A launch scene's core job is to let people start a new document or open an existing one, so it exposes the actions that drive DocumentGroup. The paired Button controls labeled Label("New", systemImage: "plus") with .buttonStyle(.borderedProminent) and Label("Open", systemImage: "folder") with .buttonStyle(.bordered) show how those two entry points sit side by side.

Try it — Change the Text("My Documents") string to your app's real name to see how the title anchors the launch screen's identity before any document opens.

Example & preview

Press Run live & edit to compile it in your browser — then edit the Swift on the left and the preview re-renders live.

DocumentGroupLaunchScene.swift
struct DocumentGroupLaunchSceneDemo: View {
    var body: some View {
        VStack(spacing: 16) {
            Image(systemName: "doc.text")
                .font(.system(size: 56))
                .foregroundStyle(.tint)
            Text("My Documents")
                .font(.title.bold())
            Text("DocumentGroupLaunchScene customizes this launch screen for a DocumentGroup app.")
                .font(.footnote)
                .foregroundStyle(.secondary)
                .multilineTextAlignment(.center)
            HStack(spacing: 12) {
                Button {
                } label: {
                    Label("New", systemImage: "plus")
                }
                .buttonStyle(.borderedProminent)
                Button {
                } label: {
                    Label("Open", systemImage: "folder")
                }
                .buttonStyle(.bordered)
            }
        }
        .padding()
    }
}
Live preview
My Documents DocumentGroupLaunchScene customizes this launch screen for a DocumentGroup app. New Open
My Documents DocumentGroupLaunchScene customizes this launch screen for a DocumentGroup app. New Open
swift → lexer → parser → sema → uiir → canvas Open in Studio ↗
What's new in SwiftUI 27 →