How it works
DefaultDocumentGroupLaunchActions is the view SwiftUI draws on a document-based app's launch experience to offer the system-standard launch actions — typically the controls for creating a new document and opening an existing one. When you build a custom launch scene with DocumentGroupLaunchScene, you supply your own background and branding, but you rarely want to reinvent how people start working; this view drops the platform's familiar New and Open affordances into your layout so they look and behave exactly as they do in Apple's own document apps. Reach for it whenever you're customizing a launch screen and want to keep the standard entry points instead of wiring up document creation by hand.
Place the standard launch actions in a custom launch scene
DefaultDocumentGroupLaunchActionsis aView, so you compose it into theoverlayActionsof aDocumentGroupLaunchScene(or anywhere in your launch layout) the same way the demo arranges its controls inside aVStack(spacing: 16). SwiftUI renders the system-provided New and Open buttons in place — you don't construct the buttons yourself, the way the example hand-builds itsButton/Labelpair as a stand-in.Let it provide the New and Open affordances
The view supplies the two primary launch actions automatically: creating a fresh document and opening an existing one. These map to the roles illustrated by the demo's
Label("New Document", systemImage: "plus")andLabel("Open", systemImage: "folder"), but withDefaultDocumentGroupLaunchActionsthe wiring to yourDocumentGroupis handled for you rather than left as emptyButton {}closures.Inherit the platform button styling
DefaultDocumentGroupLaunchActionsrenders its actions with the system's launch-screen treatment, so the New action reads as the prominent primary and Open as the secondary — the same emphasis the example fakes with.buttonStyle(.borderedProminent)and.buttonStyle(.bordered). You get that hierarchy without choosing button styles yourself, keeping the screen consistent with other document apps.Compose it alongside your own branding
Because it's an ordinary view, you can surround
DefaultDocumentGroupLaunchActionswith your custom title and supporting copy — here theText("My Documents")heading and the descriptive.font(.footnote)line — and apply layout like.padding()to the whole arrangement. The standard actions slot into your design rather than dictating it.
HStack of Button controls with DefaultDocumentGroupLaunchActions() to swap the placeholder buttons for the real system New and Open actions and see the platform styling and behavior take over.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 DefaultDocumentGroupLaunchActionsDemo: View {
var body: some View {
VStack(spacing: 16) {
Text("My Documents")
.font(.largeTitle.bold())
Text("DefaultDocumentGroupLaunchActions provides the standard New / Open buttons on a document app's launch screen.")
.font(.footnote)
.foregroundStyle(.secondary)
.multilineTextAlignment(.center)
HStack(spacing: 12) {
Button {} label: {
Label("New Document", systemImage: "plus")
}
.buttonStyle(.borderedProminent)
Button {} label: {
Label("Open", systemImage: "folder")
}
.buttonStyle(.bordered)
}
}
.padding()
}
}