As you discovered UIAction just takes a block with no keyboard shortcut support and UIKeyCommand takes a selector and has no ability to set a target (UIKeyCommand just goes through the responder chain).
For a top level action like "Show Settings" invoked from the menu bar it seems silly to me that the entire responder chain needs to be enumerated but that's how they decided to implement it in Mac Catalyst. A NSMenuItem in AppKit world can specify a target but for whatever reason they made the context menu/menu bar APIs a little weird in UIKit/Mac Catalyst.
I believe the AppDelegate is supposed to participate in the responder chain but don't think it does on Mac Catalyst which is why the menu bar item isn't validating. Add your showPreferences method on UIApplication in a Swift extension or Objective-C category instead (UIApplication is in the responder chain).
So long as nothing else in your responder chain implements a selector that collides with that name the UIApplication should always get it.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: