Post

Replies

Boosts

Views

Activity

Reply to Can I disable the New Document menu item without losing the Open menu item as well?
I think I have found my own answer now. If you only define document types in your Info.plist with a CFBundleTypeRole of Viewer, then create your DocumentGroup like so: DocumentGroup(viewing: MyDocument.self) { file in ContentView(document: file.$document) } (Note the viewing label rather than newDocument) Then your File menu will have the New item automatically disabled as there are no types defined which can create a document.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’21