I have a calculator app written in Swift, and it's fully compatible with custom keyboard shortcuts. I'm trying call a method when the user presses Command + C, however, whenever I try to assign the following custom shortcut, it just doesn't work:
UIKeyCommand(input: "c", modifierFlags: [.command], action: #selector(commandCAction))
The commandCAction
method is never called, unlike the other shortcuts. I assume this is due to Apple reserving this shortcut. Are there any observers or methods that I can use to detect when the user presses Command + C on a physical keyboard?