URLDocumentConfiguration
The configuration of an open document that stores its file URL, last modification date, and related metadata.
Declaration
@MainActor final class URLDocumentConfigurationOverview
SwiftUI passes a URLDocumentConfiguration to the makeDocument closure of DocumentGroup. This class is @Observable — views and other observers can track changes to fileURL and other properties.
Use makeFileCoordinator() to perform coordinated reads or writes outside the normal DocumentReader/DocumentWriter flow — for example, to read a single sub-file of a package document on demand:
let coordinator = configuration.makeFileCoordinator()
var error: NSError?
coordinator.coordinate(
readingItemAt: pageURL, options: [], error: &error
) { url in
let data = try? Data(contentsOf: url)
// ...
}