39.3 The DocumentGroup Scene
The DocumentGroup scene contains most of the infrastructure necessary to provide app users with the ability to create, delete, move, rename and select files and folders from within an app. An initial document group scene is declared by Xcode within the DocDemoApp.swift file as follows:
import SwiftUI
@main
struct DocDemoApp: App {
var body: some Scene {
DocumentGroup(newDocument: DocDemoDocument()) { file in
ContentView(document: file.$document)
}
}
}
As currently implemented, the first scene presented to the user when the app starts will be the DocumentGroup user interface which will resemble Figure 39-1 above. Passed through to the DocumentGroup is a DocDemoDocument instance which, along with some additional...