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.
Declare it as a scene in your App body
DocumentGroupLaunchSceneconforms toScene, so you place it inside thebodyof yourAppnext to theDocumentGroupit customizes. The system routes the cold-launch presentation through this scene before handing control to a document window like the one whose contents resemble thisDocumentGroupLaunchSceneDemoview.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.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 secondaryTextexplaining the document app illustrate the kind of branding and guidance the scene is meant to hold.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 pairedButtoncontrols labeledLabel("New", systemImage: "plus")with.buttonStyle(.borderedProminent)andLabel("Open", systemImage: "folder")with.buttonStyle(.bordered)show how those two entry points sit side by side.
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.
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()
}
}