Swift concurrency can tighten up this code:
var body: some Scene
{
DocumentGroup(newDocument: { Document() }) { _ in
ContentView()
.onAppear {
Task { @MainActor in NSApplication.shared.windows.last?.toggleFullScreen(nil) }
}
}
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: