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
Reply to TabView and Swift Charts giving inconsistent behaviour when swiping between pages
@Greigarious You are not the only one now, I've just hit this same problem! Could you please let me know your feedback number so that I can file a duplicate? Did you already include a sample project in that bug report? If not, I will do so. Thank you for discussing the workaround, I will be making use of it for now.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’24
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:
Replies
Boosts
Views
Activity
Nov ’21