In AppKit, menu items can be set up with a nil target. In that case, they are disabled unless the first responder implements the selector they are set up for.
It is also possible to have your AppKit Mac app's menu items show/hide a checkmark depending on the state of the front window/first responder. I confess it's been long enough since I wrote code to manage a checkmark on a Mac menu item, but I remember doing it.
Are either of those things possible in a SwiftUI app? If so, how?
I've added menu items using SwiftUI Buttons, and the closure of those Buttons invokes NSApp.keyWindow?.firstResponder?.tryToPerform() to send a selector to the key window. That works, but the menu item doesn't dim if the front window doesn't implement the selector, nor do I know of a way to show/hide checkmarks.
As pointed out by @sweeper, this similar to a previous question I asked about how you send a menu command to the front window. What I don't know how to do is to have the menu item change its state based on the status of the first responder (enabling/disabling based on whether the first responder responds to the select) and showing/hiding a checkmark based on the state of the first responder (the key window