Coding a SwiftUI button to trigger a Menu item

182 views Asked by At

I am trying to design a button in swiftUI that will call 1 of the built in menu items (mac only). I know how to replace built in menu item & force it to share the same functionality with a button, but that is not what I want to do. I wish to click the button for, let's say, Copy or Help & have the button (somehow) trigger or programmatically click the menu item itself. It need not display the menu, just run the item. This would be most useful in setting up a contextual menu or convenience button the only purpose of which is to mimic these menu items. I have hunted high & low with little success. Can anyone point me in the right direction or offer a thought or two?

0

There are 0 answers