I have an iOS/iPad/Macos(Catalyst) app.
There is a toolbar configured as follows:
navigationItem.rightBarButtonItems = [ UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(runSomeCode)), UIBarButtonItem(image: myImage, style: .plain, target: self, action: #selector(saveMyWork)), ...]
I want to add keyboard shortcuts. For example Cmd+'a' to perform runSomeCode
. And Cmd +'I' to perform saveMyWork
. The main target is Macos(catalyst) app.
How shall I assign these shortcuts to bar buttons?