My iPadOS app can open .xml files.
In my XMLApp.swift, I hooked up a:
var body: some Scene {
WindowGroup(id: "main") {
.commands
CommandGroup(replacing: .newItem) {
...
Button(.openDot) {
openXMLFile()
}
...
Next, I entered a new UTImportedTypeDeclarations / UTExportedTypeDeclarations in Project Settings -> Target -> Info -> Document Types, Exported Type Identifiers, Imported Type Identifiers, for the XML file-type:
...
<key>UTImportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
<string>public.xml</string>
<string>public.content</string>
</array>
...
As soon as I do that, Xcode creates an additional Open... menu entry all the way at the bottom of the File menu.
I cannot get rid of this additional menu entry. Its state is disabled (grayed out). I have my own Open (per the code above), which also responds to ⌘ - O. My menu entry works fine, as long as I disable the same keyboard shortcut so they don't collide.
The extra Open entry is also displayed on the matching iPadOS simulator.
From the same codebase, the Open is not displayed on the Mac (targeting macOS, not Catalyst). On macOS, only my Open is in the File menu, as expected.
Why is there a duplicate Open menu entry and how do I get rid of it?
0
0
96